在我按下要保存的表单集的提交按钮后,我收到此错误:“[u'ManagementForm 数据丢失或已被篡改']”
这是我的views.py中的代码
MarcheFormSet = formset_factory(PrixMarcheForm1, extra=2)
if request.method == "POST":
formset = MarcheFormSet(request.POST)
if (formset.is_valid()):
for form in formset:
print form
form.save()
return redirect("/appartement/ajouter3/")
else:
print "nope"
和我的 form.html(views.py 调用的模板)
{% if formset %}
<form action="" method='POST'>{% csrf_token %}
{{ formset.management_form }}
{% for form in formset %}
{{ form|crispy }}
{% endfor %}
<input type='submit' class='btn btn-default' value={{ outcome }}>
</form>
{% endif %}
想法将不胜感激