1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| def PageResponse(self, data, serializer_class): page = self.paginate_queryset(data) if page is not None: serialize = serializer_class( page, many=True, context={'request': self.request}, ) return self.get_paginated_response(serialize.data)
serializer = serializer_class( charges, many=True, context={'request': self.request}, ) return Response(serializer.data)
|