32 lines
921 B
Python
32 lines
921 B
Python
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,
|
|
}) |