Thread: [SQL-CVS] [ sqlobject-Bugs-1640436 ] order by several columns and inheritance
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: SourceForge.net <no...@so...> - 2007-01-20 20:14:11
|
Bugs item #1640436, was opened at 2007-01-20 21:14 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1640436&group_id=74338 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: General Group: SQLObject release (specify) Status: Open Resolution: None Priority: 5 Private: No Submitted By: Daniel Nogradi (nogradi) Assigned to: Nobody/Anonymous (nobody) Summary: order by several columns and inheritance Initial Comment: I've checked the following with sqlite only. SQLObject version: 0.8.0b1 Sql query generation is broken when using several columns as orderBy keyword argument and inherited classes: --------------------------------------------------------------- class parent( InheritableSQLObject ): pass class t( parent ): c = IntCol( ) d = IntCol( ) --------------------------------------------------------------- Using a single orderBy column works: --------------------------------------------------------------- for i in t.select( orderBy=t.q.d ): print i SELECT parent.id, parent.child_name FROM t, parent WHERE (((parent.child_name) = ('t')) AND ((t.id) = (parent.id))) ORDER BY t.d SELECT t.id, t.c, t.d, t.child_name FROM t WHERE ((t.id) = (1)) ---------------------------------------------------------------- but multiple orderBy columns throw an exception in the first query: ---------------------------------------------------------------- for i in t.select( orderBy=( t.q.c, t.q.d ) ): print i SELECT parent.id, parent.child_name FROM parent WHERE ((parent.child_name) = ('t')) ORDER BY t.c, t.d sqlobject.dberrors.OperationalError: no such column: t.c ----------------------------------------------------------------- And it seems that the problem is that the query doesn't have "FROM t, parent" only "FROM parent" (among other things) while in the first case (only one orderBy column) the query was generated correctly. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1640436&group_id=74338 |
From: SourceForge.net <no...@so...> - 2007-01-23 15:17:07
|
Bugs item #1640436, was opened at 2007-01-20 23:14 Message generated for change (Comment added) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1640436&group_id=74338 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: General Group: SQLObject release (specify) >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: Daniel Nogradi (nogradi) >Assigned to: Oleg Broytmann (phd) Summary: order by several columns and inheritance Initial Comment: I've checked the following with sqlite only. SQLObject version: 0.8.0b1 Sql query generation is broken when using several columns as orderBy keyword argument and inherited classes: --------------------------------------------------------------- class parent( InheritableSQLObject ): pass class t( parent ): c = IntCol( ) d = IntCol( ) --------------------------------------------------------------- Using a single orderBy column works: --------------------------------------------------------------- for i in t.select( orderBy=t.q.d ): print i SELECT parent.id, parent.child_name FROM t, parent WHERE (((parent.child_name) = ('t')) AND ((t.id) = (parent.id))) ORDER BY t.d SELECT t.id, t.c, t.d, t.child_name FROM t WHERE ((t.id) = (1)) ---------------------------------------------------------------- but multiple orderBy columns throw an exception in the first query: ---------------------------------------------------------------- for i in t.select( orderBy=( t.q.c, t.q.d ) ): print i SELECT parent.id, parent.child_name FROM parent WHERE ((parent.child_name) = ('t')) ORDER BY t.c, t.d sqlobject.dberrors.OperationalError: no such column: t.c ----------------------------------------------------------------- And it seems that the problem is that the query doesn't have "FROM t, parent" only "FROM parent" (among other things) while in the first case (only one orderBy column) the query was generated correctly. ---------------------------------------------------------------------- >Comment By: Oleg Broytmann (phd) Date: 2007-01-23 18:17 Message: Logged In: YES user_id=4799 Originator: NO Fixed in the revisions 2230-2232 (trunk, 0.8 branch, docs). Thank you! ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1640436&group_id=74338 |