Reputation: 3182
Here is an example how to order descending:
Entry.objects.filter(pub_date__year=2005).order_by('-pub_date', 'headline')
So we can use: '-pub_date'
.
And another example how to order by a field in another model:
Entry.objects.order_by('blog__name', 'headline')
So we can use: 'blog__name'
.
How i can do both in one query? 'blog__-name' doesn't work.
Upvotes: 2
Views: 2665