Django Rest Framework serialization of viewset response

68 Views Asked by At

I have the following ViewSet in Django Rest Framework:

class FilterProductsViewSet(viewsets.ViewSet):
    permission_classes = (permissions.IsAuthenticated,)

    @transaction.atomic
    def post(self, request):
        from inventory.models import Product, Stock

        size = len(request.data)
        response = get_filter(request.data, size)
        return Response(response)

I want the response to be paginated, but I haven't found documentation on how to do it with a ViewSet instance.

I'll appreciate your help.

0

There are 0 best solutions below