Re: [SQLObject] orderBy table.q.attribute
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Oleg B. <ph...@ph...> - 2004-04-23 15:53:51
|
On Fri, Apr 23, 2004 at 07:48:06PM +0400, Oleg Broytmann wrote: > On Fri, Apr 23, 2004 at 05:22:00PM +0200, Philippe Normand wrote: > > And, still the dash doesn't make sense to me > > because orderBy has to be a string, not a number. Anyway ... Let do it with strings: patients = Patient.select(None, orderBy="-registration_time") Traceback (most recent call last): [snip] File "/usr/local/lib/python2.3/site-packages/SQLObject/DBConnection.py", line 168, in _iterSelect cursor.execute(query) ProgrammingError: ERROR: Non-integer constant in ORDER BY SELECT ... ORDER BY 'registration_time' DESC See? SQLObject have added excessive apostrophes to the column name :( Oleg. -- Oleg Broytmann http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |