Bugs item #2492641, was opened at 2009-01-07 23:08
Message generated for change (Comment added) made by phd
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=540672&aid=2492641&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: None
>Status: Closed
>Resolution: Wont Fix
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
>Assigned to: Oleg Broytmann (phd)
Summary: orderBy sorts differ on Enums w/ MultipleJoin vs Select
Initial Comment:
Given a structure like:
class Table(SQLObject):
text = EnumCol(enumValues=['a','c','b'])
t2 = ForeignKey("Table2")
When using a regular select query like
Table.select(orderBy="text")
the resulting rows are ordered based on the ordering of the enumValues (a,c,b)
When using a MultipleJoin like
class Table2(SQLObject):
t1 = MultipleJoin("Table", joinColumn="t2_id", orderBy="text")
the list yielded from t1 is ordered based on the alphabetical ordering of the enumValues (a,b,c)
I believe this can be traced to the 'sorter' method in joins.py
Thanks,
James
----------------------------------------------------------------------
>Comment By: Oleg Broytmann (phd)
Date: 2009-04-09 21:57
Message:
Both Postgres and SQLite sort Table.select(orderBy="text") by the
alphabetical ordering (a,b,c). So it seems SQLObject does the right thing
in .sorter(). Do not rely too much on a database-specific behavior,
especially when it is broken. I am sure alphabetic ordering is the right
thing to do.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=540672&aid=2492641&group_id=74338
|