On Wed, Jun 18, 2008 at 9:58 PM, Sam's Lists <[EMAIL PROTECTED]> wrote: > I have a select like this: > > progs_running = list(ProgRun.select(AND(ProgRun.q.progressID == '3', > ProgRun.q.pingTime > > cutoff), > > orderBy=ProgRun.q.theCompany)) > > where theCompany is a foreign key. > > What I'd really like to do though is order it by the company name, which is > stored in the table that the foreign key theCompany connects to.
You can try something like: ProgRun.select(AND( ProgRun.q.progressID == '3', ProgRun.q.pingTime > cutoff, ProgRun.q.the_company_id == Company.q.id ), orderBy=Company.q.name) I haven't tested this and I don't know the name of the class that theCompany attribute links to so it may need some tweaking. ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php _______________________________________________ sqlobject-discuss mailing list sqlobject-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss