Hello @kartik,
Fixed this by creating custom pagination class. and setting desired pagesize in class. I have used this class as pagination_class in my viewset.
from rest_framework import pagination
class ExamplePagination(pagination.PageNumberPagination):
page_size = 2
class HobbyCategoryViewSet(viewsets.ModelViewSet):
serializer_class = HobbyCategorySerializer
queryset = UserHobbyCategory.objects.all()
pagination_class=ExamplePagination
Simple solution is set it like
pagination.PageNumberPagination.page_size = 100
In ViewSet.
class HobbyCategoryViewSet(viewsets.ModelViewSet):
serializer_class = HobbyCategorySerializer
queryset = UserHobbyCategory.objects.all()
pagination.PageNumberPagination.page_size = 100
Hope it helps!!
Thanks!!