hello everyone,
i have mad a custom admin page using django forms.
I have a form that I want to set values dynamicly using an exiting model that come via ajax request.
the html:
{% csrf_token %} <div class="input-con">
<span class="input-name">מספר קורס</span>
{{course_form.course_slug}}
</div>
</div>
<div class="input_single">
<div class="input-con">
<span class="input-name">תיאור הקורס</span>
{{course_form.description}}
</div>
</div>
<div class="input_double">
<div class="input-con">
<span class="input-name">משפט מפתח</span>
{{course_form.title_description}}
</div>
<div class="input-con">
<span class="input-name">מחיר</span>
{{course_form.price}}
</div>
</div>
<div class="input_double extra_margin">
<div class="input-con autor_selected">
<span class="input-name">שם היוצר</span>
<!--{{course_form.autor}}!-->
{{course_form.autor}}
<span class="input-name">מוכן להצגה</span>
<!--{{course_form.autor}}!-->
{{course_form.display}}
</div>
<div class="input-con selected_div">
<span class="input-name">קורסים חוסמים</span>
{{course_form.blocked_by}}
</div>
</div>
<div class="full_width">
<div class="image_container">
<img style="background-image:url({% static 'main_website\images\graduation.png' %})" id="display_image" alt="">
</div>
<div class="input-con center_on_image">
{{course_form.image}}
<label for="upload"><i class="fas fa-upload"></i></label>
</div>
</div>
<div class="full_width_button">
<button class="cta">
<span>עדכן פרטים</span>
<svg width="15px" height="10px" viewBox="0 0 13 10">
<path d="M11,5 L1,5"></path>
<polyline points="4 1 0 5 4 9"></polyline>
</svg>
</button>
</div>
</form>
i recive the information via ajax and i want to update the form (set the name and stuff), is there a django/ajax function to do so or do i need to make it be hand?