From: Randall R. <ra...@ra...> - 2003-11-05 04:03:57
|
Does using a negative for orderBy work in 0.5? I'm not sure what I'm doing wrong here, if anything: >>> views = AdView.select(orderBy="-id") >>> len(views) 43 >>> views[0] Traceback (most recent call last): File "<stdin>", line 1, in ? File "/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site- packages/SQLObject/SQLObject.py", line 1175, in __getitem__ return list(self.clone(start=start, end=start+1))[0] File "/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site- packages/SQLObject/DBConnection.py", line 168, in _iterSelect cursor.execute(query) psycopg.ProgrammingError: ERROR: Non-integer constant in ORDER BY SELECT ad_view.id, ad_view.ad_id, ad_view.internet_address, ad_view.view_time, ad_view.hit_time FROM ad_view WHERE 1 = 1 ORDER BY 'id' DESC LIMIT 1 Everything seems in order except for the quotes around 'id'. This happened with a 0.4x I had, which was why I just upgraded to 0.5. Note for those upgrading to 0.5 : Delete the old installation first, or you'll get lots of errors about import. :) Perhaps this is common knowledge... -- Randall Randall ra...@ra... |