So, how I actually solved it was even a bit different:
Document.objects.filter(documentType=1,
event__eventType=1).annotate(Max('event__start_date')).order_by('event__start_date__max')
I had to use the Max function because the relationship is actually a many to
many. Even if it was just a standard foreign key this is still an option,
and it eliminates the problem of re-querying if you later decide to use
other fields.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/django-users/-/LJZowJhdGbkJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.