Is it possible to set the default sort order for a model to a field from a related model (rather than the integer key) i.e. something that yields a SQL order by clause with a field from both models? If so, how? I can do this via query_by but I can't figure out how to set it by default. Thanks.
class Foo(models.Model):
name = models.CharField(max_length=50)
class Bar(models.Model):
related = models.ForeignKey(Foo)
bar_date = models.DateField()
class Meta:
ordering = ('bar_date', 'related.name', )