Getting a 'modelformset_factory without defining 'fields' error' using Django inline formset. What am I doing wrong?
I'm not sure but I think you forgot to pass the form to inlineformset_factory
:
FamilyMemberFormSet = inlineformset_factory(Member, FamilyMember, form=MemberForm)
Or you should specify what fields should be included/excluded using either fields
parameter or exclude
.
See some examples in Django doc about inlineformset_factory.
here you are:
FamilyMemberFormSet = inlineformset_factory(Member, FamilyMember, fields =['name', 'occupation',])