I'm running through some djagno API examples and I'm having a problem with how to order by a field in a different table. Here is what my models:
class Blog(models.Model): name = models.CharField(maxlength=100) tagline = models.TextField() def __unicode__(self): return self.name class Admin: pass class Author(models.Model): name = models.CharField(maxlength=50) email = models.EmailField() def __unicode__(self): return self.name class Admin: pass class Entry(models.Model): blog = models.ForeignKey(Blog) headline = models.CharField(maxlength=255) body_text = models.TextField() pub_date = models.DateTimeField() authors = models.ManyToManyField(Author) def __unicode__(self): return self.headline class Admin: pass ///////// The documentation says that this will work: Entry.objects.order_by('blogs_blog.name', 'headline') However, when I run the above command I get the following error: OperationalError: no such column: blogs_blog.name //////////////// I don't understand blogs_blog.name? Thanks for your help --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---