How to edit many objects at the same time in django?
<p>Well, usually, when I like edit one object I using instance and get_object_or_404, something like this:</p>

<pre><code>question = get_object_or_404(Question, id = id)
form = FormQuestion(request.POST, instance=question)
if  request.method == 'POST':
    if form.is_valid():
        form.save()
        return redirect('/Something/')
else:
    form = FormQuestion(instance = question)
return render(request, {'form':form}, 'Ask/question.html')
</code></pre>

<p>Using this code I can edit one object, the problem is: I need to list all questions and the fields will be editable, but I can't find a way to do this.</p>

<p>Someone has a method or a code who resolve my problem?</p>

<p>First place, is much better you develop in CBV(Class Based Views), where you will do the view more easily.</p>

<p>I had a problem around your problem, follow how do it:
<a href="http://stackoverflow.com/questions/39534543/django-inlineformset-factory-how-to-edit">Django - inlineformset-factory (How to Edit)</a>
And you need formset-factory and/or inlineformset-factory.
And here: <a href="http://django-crispy-forms.readthedocs.io/en/latest/crispy_tag_formsets.htm" rel="nofollow">http://django-crispy-forms.readthedocs.io/en/latest/crispy_tag_formsets.htm</a>.</p>

<p><a href="https://docs.djangoproject.com/en/dev/topics/forms/formsets/#using-more-than-one-formset-in-a-view" rel="nofollow">https://docs.djangoproject.com/en/dev/topics/forms/formsets/#using-more-than-one-formset-in-a-view</a></p>

<p>I hope I've helped</p>

python django edit