It sort of works, but I had to do one tweak on the forms.BaseFormSet:
@forms.BaseFormSet.cleaned_data.setter
def cleaned_data(self, value):
# this setter is needed, because MultiForm sets cleaned_data during
# vallidation and it's not defined on BaseFormSet by default in Django 1.8
for i, data in enumerate(value):
self.forms[i].cleaned_data = data
because MultiForm sets the cleaned_data during its own cleaning.
The other issue I'm having is during tests. When I use
then it's quite a digging, to get all the form data (management_form of the BaseFormSet). Would it be possible to make using BaseFormSet with MultiForm easier? I haven't checked the code, so I don't know myself, what would be needed.
I have a following setup:
It sort of works, but I had to do one tweak on the
forms.BaseFormSet
:because
MultiForm
sets thecleaned_data
during its own cleaning.The other issue I'm having is during tests. When I use
then it's quite a digging, to get all the form data (
management_form
of theBaseFormSet
). Would it be possible to make usingBaseFormSet
withMultiForm
easier? I haven't checked the code, so I don't know myself, what would be needed.