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
|