I'm facing a quite challenging taks:
I need an inlineformset_factory
connecting my ParentEntity
to my foreign key-bound ChildEntities
.
My ChildEntity
contains a foreign key relation I need to filter per logged-in user - so I need the request in the ChildForm
.
What I've tried so far:
- I tried to use the
form=
kwarg but I can't pass an instance - just a class. So no way for me to add the request here. - I tried to use the
formset=
kwarg but when I try to pass therequest=request
as a kwarg of theinlineformset_factory
I get an error (Unexpected kwarg)
Any idea what I can do?
Thanks! Ron