django-rest-framework
django-rest-framework copied to clipboard
Added request param to paginate_queryset in ListModelMixin
In standard PageNumberPagination, paginate_queryset requires request, so this method in ListModelMixin is to be rewritten every time:
def paginate_queryset(self, queryset): return super().paginate_queryset(queryset, self.request)
This code fixes this bug
The .paginate_queryset which the ListModelMixin is expecting is that of GenericAPIView not any of a pagination class.
https://github.com/encode/django-rest-framework/blob/5a01a4c8a900a98ca0186b742d03d02c55846632/rest_framework/generics.py#L169-L175
This is not required.
TL; DR: mixins are to be used with views/viewsset.
I guess we can close this