Re: [SQLObject] Best way to order columns
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Ian B. <ia...@co...> - 2003-07-10 19:23:10
|
On Wed, 2003-07-09 at 13:01, Mark Melvin wrote: > I have two questions: > > 1) What is the best way force a particular order to the columns returned by > a select()? > > By this I do not mean sorting records - I mean the order of the columns. > So for a given select(), SQLObject returns the columns in the order they > appear in the database. Is there a way to specify a new default in which > they are returned, or do I have to reorder them myself after I do a > select()? Columns aren't ordered as they are returned -- full objects with attributes for the columns are returned. > 2) In terms of sorting records, it appears that when I specify a join, I > can use the orderBy keyword and pass it a list and it will happily sort the > items based on the order of the items in the list (at least it appears to > work that way). However the _defaultOrder class variable will not take a > list. Is there any way to specify more than one parameter to the SQL that > is generated for the "ORDER BY" clause as the default for select()? There was supposed to be :( I guess I forgot the last part of implementing it. Bad me for not making the right test. CVS has this fix. I think I'll put out a 0.4.1 before too long as well. Ian |