Re: Using order_by with a field from a different table

2007-08-15 Thread Michael
Hi Greg, I think the documentation needs an update, but you need to make sure that the query includes the column that you want to order by... in Django terms the easiest way is to use the select_related method. So you should find that your view query works if you modify it slightly to: Entry.obj

Using order_by with a field from a different table

2007-08-05 Thread Greg
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.n