python - I how can I return objects in Django? -


the following

model.objects.all()[:10]

will return 10 records ordered primary key. i'm trying objects in reverse order. in other words if highest primary key 5000, i'm trying 5000, 4999, 4998...

i have tried:

model.objects.reverse().all()[:10] 

but not appear affect order

you can do:

model.objects.order_by('-id')[:10] 

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Socket.connect doesn't throw exception in Android -

iphone - How do I keep MDScrollView from truncating my row headers and making my cells look bad? -