According to the documentation, nothing special is required to enable pagination when using a class inheriting from GenericAPIView
.
I've looked in the code of django and django rest framework and the ViewSet queryset doesn't seem ordered. The pagination only adds the SQL keywords LIMIT
and OFFSET
to the query.
What I don't understand is how is handled a queryset that doesn't have a deterministic order ? Why the documentation doesn't say to add a .order_by()
statement at the end of the ViewSet queryset ?