ManagementForm data missing error while formset validation

假如想象 提交于 2019-12-06 04:42:25

Is the management data in request.POST? http://docs.djangoproject.com/en/dev/topics/forms/formsets/#understanding-the-managementform

The following info has to be in request.POST:

data = {
    'form-TOTAL_FORMS': u'1',
    'form-INITIAL_FORMS': u'0',
    'form-MAX_NUM_FORMS': u'',
}

There is a shortcut for rendering the hidden fields: {{ my_formset.management_form }}

rendering the formset.management_form in the template

{{fset.management_form}}

this allows the management form data available and hence data is complete.But if prefix is added while genarating formsets

adding prefix should fix that issue.

fset = ffact(request.POST,prefix='pfix')
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!