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 pic
As an addition and observation to the other useful answers, it's worth noticing that actually doing [:10] as slicing will return the first 10 elements of the list, not the last 10...
To get the last 10 you should do [-10:] instead (see here). This will help you avoid using order_by('-id') with the - to reverse the elements.