how to get an empty formset in a formwizard?
|Reported by:||hs4-mayer@…||Owned by:||nobody|
|Severity:||Keywords:||empty formset, formwizard,|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
I've already spent a lot of time trying to get this to work, without success! I have a formwizard which includes a modelform and a modelformset which should be empty.
On the first page i display the form, on the second follows the modelformset, which should be empty and used to add new rows. But it always displays all available table rows.
I've already tried the following:
def init(self, *args, kwargs):
super(BaseMyModelFormSet, self).init(*args, kwargs)
self.queryset = MyModel2.objects.none()
In urls.py I did the following:
(r'...$', MyFormWizard([MyModelForm1, modelformset_factory(MyModel2, formset=BaseLVFormSet), MyModelForm3])), ...
But nothing changed... still all available rows are displayed in the modelformset.
After that I tried:
MyModel2FormSet = modelformset_factory(MyModel2)
formset = MyModel2FormSet(MyModel2.objects.none())
(r'...$', MyFormWizard([MyModelForm1, formset, MyModelForm3])), ...
Now I get an error message, which tells me that MyModel2FormFormSet isn't callable...
Does anyone know what I'm doing wrong? I'm grateful for every hint ;)