Minor upgrades and test fixes.
[wolnelektury.git] / src / api / pagination.py
1 from rest_framework.pagination import LimitOffsetPagination, PageLink
2 from rest_framework.response import Response
3
4
5 class WLLimitOffsetPagination(LimitOffsetPagination):
6     def get_paginated_response(self, data):
7         return Response({
8             "member": data,
9             "totalItems": self.count,
10             "view": {
11                 "previous": self.get_previous_link(),
12                 "next": self.get_next_link(),
13             }
14         })