mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-17 19:52:25 +03:00
Last ordering filter has the last say
This commit is contained in:
parent
63063da082
commit
409d784ce8
|
@ -822,8 +822,8 @@ class CursorPagination(BasePagination):
|
||||||
|
|
||||||
if ordering_filters:
|
if ordering_filters:
|
||||||
# If a filter exists on the view that implements `get_ordering`
|
# If a filter exists on the view that implements `get_ordering`
|
||||||
# then we defer to that filter to determine the ordering.
|
# then we defer to the last such filter to determine the ordering.
|
||||||
filter_cls = ordering_filters[0]
|
filter_cls = ordering_filters[-1]
|
||||||
filter_instance = filter_cls()
|
filter_instance = filter_cls()
|
||||||
ordering_from_filter = filter_instance.get_ordering(request, queryset, view)
|
ordering_from_filter = filter_instance.get_ordering(request, queryset, view)
|
||||||
if ordering_from_filter:
|
if ordering_from_filter:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user