I have an Event model:

    class Event(Model):
        parent = models.ForeignKey('self', related_name='children')
        date = models.DateField()

My question is: given a queryset of this model, how can I order it based on the 
Events' children's dates so that (say) Events with child Events with more 
recent dates are first?

(I thought that 

    .order_by('-children__date')

might be a start, but in fact that seems to do something very odd to the items 
in the list, which I am looking at separately).

Thanks,

Daniele

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to