mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-23 14:40:06 +03:00
Add comment
This commit is contained in:
parent
0dd0873b41
commit
c535420525
|
@ -634,6 +634,7 @@ class CursorPagination(BasePagination):
|
|||
|
||||
filter_query = Q(**kwargs)
|
||||
# If some records contain a null for the ordering field, don't lose them.
|
||||
# When reverse ordering, nulls will come last and need to be included.
|
||||
if (reverse and not is_reversed) or is_reversed:
|
||||
filter_query |= Q(**{order_attr + '__isnull': True})
|
||||
queryset = queryset.filter(filter_query)
|
||||
|
|
Loading…
Reference in New Issue
Block a user