If you have a FormWizard step that generates a form(set) via FormSet.form_factory() then you end up with a mess where FormWizard drops a formtools.wizard.views.ManagementForm into the page but it's validated inside Django as if it's a django.forms.formset.ManagementForm.
This manifests as either a "management form has been messed with" error or an KeyError when FormSet.full_clean() does self.management_form.cleaned_data[TOTAL_FORM_COUNT].
I figured out that you can get around this by handing formset_factory a custom FormSet that overrides the non_form_errors() method, but it's a crude fix I'm not sure will be very portable.
IMHO FormWizard should provide a proper FormSet base class for use in formset_factory that creates management forms that will survive validation.
If you have a FormWizard step that generates a form(set) via
FormSet.form_factory()
then you end up with a mess where FormWizard drops aformtools.wizard.views.ManagementForm
into the page but it's validated inside Django as if it's adjango.forms.formset.ManagementForm
.This manifests as either a "management form has been messed with" error or an
KeyError
whenFormSet.full_clean()
doesself.management_form.cleaned_data[TOTAL_FORM_COUNT]
.I figured out that you can get around this by handing
formset_factory
a customFormSet
that overrides thenon_form_errors()
method, but it's a crude fix I'm not sure will be very portable.IMHO FormWizard should provide a proper
FormSet
base class for use informset_factory
that creates management forms that will survive validation.