cineclub-site/server/myapi/pagination/PagePaginationWithPageCount.py
_aandres f6bf4ce618 feat [front,api]: pagination calendar and admin list
- extract list for home in action to not paginate

- compute calendar list from parent to paginate
2023-01-29 00:00:21 +01:00

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
})