I want to take the last 10 instances of a model and have this code:

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

Is it true that firstly pick up all instances, and then take only 10 last ones?
Is there any more effective method?

7 Answers
7

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *