I have a simple nested router using drf-nested-routers, similar to the example on the readme page. The list view on the nested route does not paginate at all, ignoring my DEFAULT_PAGINATION_CLASS
setting. Is this by design? Do nested routes have to manually implement pagination? If I try to call self.get_paginated_response
in my nested viewset's list
method, I get this error:
AttributeError at /api/foo/13/bar/
'PageNumberPagination' object has no attribute 'page'
Here's my list
method in my nested view:
def list(self, request, workplan_pk=None):
milestones = self.get_queryset()
wp = get_object_or_404(Workplan, pk=workplan_pk)
milestones = milestones.filter(workplan=wp)
return Response(self.get_serializer_class()(milestones, many=True, context={'request': request}).data)