@@ -45,16 +45,6 @@ def _divide_with_ceil(a, b):
45
45
return a // b
46
46
47
47
48
- def _get_count (queryset ):
49
- """
50
- Determine an object count, supporting either querysets or regular lists.
51
- """
52
- try :
53
- return queryset .count ()
54
- except (AttributeError , TypeError ):
55
- return len (queryset )
56
-
57
-
58
48
def _get_displayed_page_numbers (current , final ):
59
49
"""
60
50
This utility function determines a list of page numbers to display.
@@ -332,7 +322,7 @@ class LimitOffsetPagination(BasePagination):
332
322
template = 'rest_framework/pagination/numbers.html'
333
323
334
324
def paginate_queryset (self , queryset , request , view = None ):
335
- self .count = _get_count (queryset )
325
+ self .count = self . get_count (queryset )
336
326
self .limit = self .get_limit (request )
337
327
if self .limit is None :
338
328
return None
@@ -468,6 +458,15 @@ def get_schema_fields(self, view):
468
458
)
469
459
]
470
460
461
+ def get_count (self , queryset ):
462
+ """
463
+ Determine an object count, supporting either querysets or regular lists.
464
+ """
465
+ try :
466
+ return queryset .count ()
467
+ except (AttributeError , TypeError ):
468
+ return len (queryset )
469
+
471
470
472
471
class CursorPagination (BasePagination ):
473
472
"""
0 commit comments