Re: [Sqlalchemy-tickets] [sqlalchemy] #2848: RowProxy don't get sorted as expected
Brought to you by:
zzzeek
|
From: sqlalchemy <mi...@zz...> - 2013-10-21 14:51:57
|
#2848: RowProxy don't get sorted as expected
------------------------------+----------------------------------
Reporter: pakal | Owner: zzzeek
Type: defect | Status: new
Priority: high | Milestone: 0.9.0
Component: engine | Severity: minor - half an hour
Resolution: | Keywords:
Progress State: needs tests |
------------------------------+----------------------------------
Changes (by zzzeek):
* priority: medium => high
* status_field: awaiting triage => needs tests
* component: cextensions => engine
* severity: no triage selected yet => minor - half an hour
* milestone: => 0.9.0
Comment:
patch:
{{{
#!diff
diff --git a/lib/sqlalchemy/engine/result.py
b/lib/sqlalchemy/engine/result.py
index 0e23165..93c7d3b 100644
--- a/lib/sqlalchemy/engine/result.py
+++ b/lib/sqlalchemy/engine/result.py
@@ -125,8 +125,11 @@ class RowProxy(BaseRowProxy):
__hash__ = None
+ def __lt__(self, other):
+ return tuple(self) < tuple(other)
+
def __eq__(self, other):
- return other is self or other == tuple(self)
+ return other is self or tuple(other) == tuple(self)
def __ne__(self, other):
return not self.__eq__(other)
}}}
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2848#comment:1>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|