We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 11f7342 + 89654e1 commit 2fc9059Copy full SHA for 2fc9059
2 files changed
api/pagination.py
@@ -0,0 +1,16 @@
1
+from django.core.paginator import Paginator
2
+from django.utils.functional import cached_property
3
+
4
+from rest_framework_json_api.pagination import PageNumberPagination
5
6
7
+class FuzzyPaginator(Paginator):
8
9
+ @cached_property
10
+ def count(self):
11
+ return self.object_list.fuzzy_count()
12
13
14
+class FuzzyPageNumberPagination(PageNumberPagination):
15
16
+ django_paginator_class = FuzzyPaginator
api/urls.py
@@ -9,7 +9,7 @@
from share import models
from api import views
-from api.pagniation import FuzzyPageNumberPagination
+from api.pagination import FuzzyPageNumberPagination
from api.serializers import BaseShareSerializer
from api.views.share import ShareObjectViewSet
0 commit comments