Closed typonaut closed 2 years ago
Ok, worked it out – I was thinking that InlineFormSetFactory
was a form, when in fact it is a view:
views.py
class devMemberReg(InlineFormSetFactory):
# This is a VIEW, not a FORM
model = Member_Register
form_class = devControlRegisterLineForm # form for "inline/child"
factory_kwargs = {'extra': 1, 'max_num': 100,
'can_order': False, 'can_delete': False}
class devRegisterView(UpdateWithInlinesView):
model = Register
inlines = [devMemberReg] #InlineFormSetFactory immediately above
template_name = 'manage/dev/register_edit.html'
form_class = ControlRegisterForm # form for "parent"
def get_success_url(self):
return …
This way the widgets on the form_class devControlRegisterLineForm
behave as expected.
Could someone kindly point me in the right direction for using widgets with UpdateWithInlinesView?
I have tried the following:
Thank you