Hello all,

According to the documentation, nothing special is required to enable 
pagination when using a class inheriting from GenericAPIView. I've looked 
to the code of django and django rest framework and the ViewSet queryset 
doesn't seem ordered when using this pagination. It only adds the SQL 
keywords LIMIT and OFFSET to the query (using django paginator class). 

Other pagination enforces order. For example, PageNumberPagination will 
order the queryset 
(see 
https://github.com/tomchristie/django-rest-framework/blob/master/rest_framework/pagination.py#L467).

What I don't understand is how PageNumberPagination handles 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 ?

I have also opened a question on stackoverflow 
(http://stackoverflow.com/questions/42306415/pagenumberpagination-and-a-queryset-without-fixed-order)
 
but I only got general answers on the fact that responses to SQL query 
without ORDER BY keywords are not ordered.

Thank you for your help,

-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to