I have a basic formwizard example from the Django 1.4 documentation:
https://docs.djangoproject.com/en/1.4/ref/contrib/formtools/form-wizard/When I replace the forms with a modelform and a formset i keep getting validation errors:
(ManagementForm data is missing or has been tampered with)
The documentation says:
WizardView supports
ModelForms and
ModelFormSets. Additionally to
initial_dict, the
as_view() method takes
an
instance_dict argument that should contain instances of
ModelForm and
ModelFormSet. Similarly to
initial_dict, these
dictionary key values should be equal to the step number in the form list.
Could anybody provide me with an example? Does the validation error have something to do with the instance_dict?
Let say i have these forms:
class Address(models.Model):
street = models.CharField(max_length=20)
class AddressForm(ModelForm):
class Meta:
model = Address
class OrderForm(forms.Form):
Order = forms.ModelChoiceField(queryset=Article.objects.all())
OrderFormset = modelformset_factory(Order)