_aandres
f6bf4ce618
- extract list for home in action to not paginate - compute calendar list from parent to paginate
13 lines
423 B
Python
13 lines
423 B
Python
from rest_framework import pagination
|
|
from rest_framework.response import Response
|
|
|
|
|
|
class PagePaginationWithPageCount(pagination.PageNumberPagination):
|
|
|
|
def get_paginated_response(self, data):
|
|
return Response({
|
|
'current_page': self.page.number,
|
|
'total_results': self.page.paginator.count,
|
|
'total_pages': self.page.paginator.num_pages,
|
|
'results': data
|
|
})
|