[Django]-Editing related objects in ModelFormSet

6πŸ‘

βœ…

It looks like you are manually rendering the form in your template, and missing out the id field. Make sure you include {{ form.id }} for each form in the formset.

<form method="post" action="">
    {{ formset.management_form }}
    {% for form in formset %}
        {{ form.id }}
        <ul>
            <li>{{ form.title }}</li>
        </ul>
    {% endfor %}
</form>

See the docs on using model formsets in the template for more information.

πŸ‘€Alasdair

Leave a comment