Django Formset.is_valid() failing for extra forms

前端 未结 2 784
孤街浪徒
孤街浪徒 2020-12-30 04:20

In my Django application application I have a formset that is created from a simple (not-model) form, with the extra=1 (to allow javasript to add more forms later on).

2条回答
  •  萌比男神i
    2020-12-30 04:31

    This is not the usual behavior of formsets. Formsets pass empty_permitted=True to all "extra" forms, and a form with empty_permitted that hasn't been modified should always pass validation. Note that this works just fine in the Django admin (if you use inlines).

    You must be doing something else in your code that is breaking this behavior somewhere. Post the full code of the relevant form?

提交回复
热议问题