from rest_framework.pagination import LimitOffsetPagination from rest_framework.response import Response class AllTestsPagination(LimitOffsetPagination): def get_paginated_response(self, data): return Response({ 'total_count':self.count, 'limit': self.limit, 'offset': self.offset, 'results': data, }) class AppointmentUserPagination(LimitOffsetPagination): def get_paginated_response(self, data): return Response({ 'total_count': self.count, 'limit': self.limit, 'offset': self.offset, 'results': data, }) class AccomplishedPagination(LimitOffsetPagination): def get_paginated_response(self, data): return Response({ 'total_count': self.count, 'limit': self.limit, 'offset': self.offset, 'results': data, })