I know that I can pass formset to inlineformset_factory and this by default takes BaseInlineFormSet. I also know that BaseInlineFormSet can take a queryset as a parameter. How do I connect the dots to allow me to pass in a queryset which is based on the request to the BaseInlineFormSet.
In short I want to do this.
base_qs = Inline_model.objects.filter(user = self.request.user)
factory_kwargs = { formset=BaseInlineFormSet(queryset=base_qs) }
formset = inlineformset_factory(ModelA, Inline_model, **factory_kwargs())
Any help would be appreciated.
FWIW this was solved using the following method. I shifted to using a class based view and using the django-extra-views package. This seemlessly allowed me to override the
get_formset_kwargsmethod with my own queryset.