mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-04 20:40:14 +03:00
Merge 539748cb69
into 6831472a62
This commit is contained in:
commit
a4c34a85bf
|
@ -503,10 +503,11 @@ class CursorPagination(BasePagination):
|
|||
(offset, reverse, current_position) = self.cursor
|
||||
|
||||
# Cursor pagination always enforces an ordering.
|
||||
if reverse:
|
||||
queryset = queryset.order_by(*_reverse_ordering(self.ordering))
|
||||
else:
|
||||
queryset = queryset.order_by(*self.ordering)
|
||||
if not queryset.ordered:
|
||||
if reverse:
|
||||
queryset = queryset.order_by(*_reverse_ordering(self.ordering))
|
||||
else:
|
||||
queryset = queryset.order_by(*self.ordering)
|
||||
|
||||
# If we have a cursor with a fixed position then filter by that.
|
||||
if current_position is not None:
|
||||
|
|
Loading…
Reference in New Issue
Block a user