to_inventory/back/tgbot/pagination.py

11 lines
353 B
Python

from rest_framework import pagination
from rest_framework.response import Response
class CustomPagination(pagination.PageNumberPagination):
def get_paginated_response(self, data):
return Response({
'count': self.page.paginator.count,
'per_page': self.page.paginator.per_page,
'results': data
})