T
T
to_east2018-06-13 04:23:22
Django
to_east, 2018-06-13 04:23:22

Group editing of items on one page?

Greetings Toaster Members!
Is it possible to group edit records rendered by one form.
To be more specific, for example, we have the form:

from django import forms

class FoobarForm(forms.Form):
    foo = forms.CharField()
    bar = forms.CharField()

And the template looks like this:
{% for item in foobar %}
    {{ form }}
{% endfor %}
<input type="submit">Submit</input>

You must send a batch of copies of completed or blank forms. As I understand it, it is necessary to mark each form with a unique identifier, with the same id, but how to process the array of forms in the post handler?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Eugene, 2018-06-13
@to_east

You need to use Django Formsets .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question