Hello,

Is it possible to order a query by a ManyToManyField?  For example,  
in the models below, I'd like to select all Entries and order by the  
Author's name.  Something to the effect of Entry.objects.all 
().order_by('authors__name')?

Thanks,
Brian

class Author(models.Model):
     name = models.CharField(maxlength=50)
     email = models.URLField()

class Entry(models.Model):
     headline = models.CharField(maxlength=255)
     body_text = models.TextField()
     pub_date = models.DateTimeField()
     authors = models.ManyToManyField(Author)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to