问题
I have a FormWizard that displays three parts of a registration application. The last part involves creating a group and adding members to it. I would like to present two forms at once on the same view.
Group Builder
class GroupBuilder(forms.Form):
name = forms.CharField(max_length=30,
widget=forms.TextInput(attrs={
'placeholder': 'eg. The Underdogs'}))
Member Builder
class MemberBuilder(forms.Form):
first_name = forms.CharField(max_length=128)
last_name = forms.CharField(max_length=128)
role = forms.CharField(max_length=128)
How can I present the GroupBuilder Form and a StudentBuilder formset at once?
来源:https://stackoverflow.com/questions/24090043/combining-a-form-and-a-formset-in-django