I am using rest_framework.pagination.LimitOffsetPagination in combination with Django's sort filter (with filter_backends = [OrderingFilter] and ordering_fields in my view). The problem is that Django appears to be applying the sort on the pagination results, and not the other way around.
Analogy with a list:
If the results of the get_queryset are:
['b', 'e', 'c', 'a', 'd', 'f']
Pagination is applied first (e.g. with a limit of 3):
['b', 'e', 'c']
And then the results are sorted:
['b', 'c', 'e']
The result I would expect, however, is:
['a', 'b', 'c']
Any ideas how I can get sorting applied before pagination?
Thank you very much in advance.