1class BookSubmitForm(ModelForm):
2 def __init__(self, *args, **kwargs):
3 self.request = kwargs.pop("request")
4 super(BookSubmitForm, self).__init__(*args, **kwargs)
5 self.fields["book"].queryset = Book.objects.filter(owner=self.request.user)
6 self.fields["whatever"].queryset = WhateverModel.objects.filter(user=self.request.user)
7