dimanche 19 mars 2017

Ordering and slicing a django queryset

I'm trying to make a query which orders the objects and then returns the first 100.

Orders.objects.order_by('date', 'time')[:100]

However I get this error.

Cannot reorder a query once a slice has been taken.

How would I make this query?




Aucun commentaire:

Enregistrer un commentaire