FormWizard with Formset and Form Fields mixed on same page
|Reported by:||Owned by:||nobody|
|Cc:||hv@…, thepapermen, Bouke Haarsma, Mathijs de Bruin||Triage Stage:||Accepted|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
I would like to request something like the following:
On a given page in a FormWizard, support the ability to mix a formset along with other form fields.
A use-case would be a page in a wizard that lets you add N users to email, and a textarea to customize this email.
The code for such a thing would look like
# Step 1 in wizard class Step1Form(forms.Form): # interesting form fields... # Form for the email addresses used in Step 2 Formset class EmailAddressForm(forms.Form): email = forms.EmailField() # Step 2 in wizard class EmailAddressesAndText(forms.Form): emailText = forms.Textarea() emailAddressFormSet = formset_factory(EmailAddressForm, can_delete=True, ...)
## named_formwizard_forms = ( ('Step1', Step1Form), ('Step2', EmailAddressesAndText), )
This would be a very clean way to mix form fields and an embedded formset in a way that can be leveraged as part of the FormWizard found in 1.4
Change History (11)
comment:1 Changed 4 years ago by
|Status:||new → closed|
|Triage Stage:||Unreviewed → Accepted|