From: Christopher S. <csi...@gm...> - 2007-05-09 03:35:37
|
On Tuesday 08 May 2007 19:53, rdm...@bi... wrote: > On Tue, 8 May 2007 at 18:27, Christopher Singley wrote: > > On Tuesday 08 May 2007 12:08, Jim Steil wrote: > >> What I'm > >> trying to do is get a list of requisitions sorted by plant name. > > > > Why not get a list of requisitions, and then sort it by plant name? > > > > list(Requisition.select()).sort(key = lambda x: x.plant.name) > > Because he's trying to do it in a context where things are a lot simpler > if the result is a SelectResults object. I know because I read his > earlier post on the TurboGears mailing list :) > > --David Oh. Well how about this, then: Requisition.select(Requisition.q.plantID==Plant.q.id, orderBy=Plant.q.name) cs |