Is there any particular reason why it's assumed you won't be performing a 
Max on a CharField? 

I tried to create the following QuerySet:

Document.objects.filter(documentType=1, 
event__eventType=3).annotate(event_date=Max('event__start_date'), 
subcommittee=Max('event__subcommittee__name')).order_by('subcommittee', 
'event_date')

I enforce this particular documentType to occur only once per Event, but in 
reality the Document - Event relation is many to many. That is why I 
performed a Max on the to go from Document to a FK relation of Event.

I really only ask out of curiosity. As far as SQL goes, this is completely 
legit and I plan on modifying Django and submitting a patch. (Unless there's 
a compelling reason not to)

-- 
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/-/nQfxnZlrOskJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to