Is it possible to sort results returned by SQLObject by a value of another table?
I have two tables:
class Foo(SQLObject):
bar = ForeignKey('Bar')
class Bar(SQLObject):
name = StringCol()
foos = MultipleJoin('Foo')
I'd like to get foos sorted by the name of a bar they are related to.
Doing:
foos = Foo.select().orderBy(Foo.q.bar)
...would sort the output by bar's ids, but how do I sort them by bar's name?