The BookManager
model requires a parameter for the request.user
:
class BookManager(models.Manager):
def get_queryset(self, user):
return super().get_queryset().filter(author=user)
This prevents an AttributeError
when calling the get_queryset
method, as it now requires the parameter user
to be passed.