Re: [Sqlalchemy-tickets] [sqlalchemy] #2813: Buglette with annotated join condition
Brought to you by:
zzzeek
|
From: sqlalchemy <mi...@zz...> - 2013-08-28 11:29:27
|
#2813: Buglette with annotated join condition
------------------------------+----------------------------------
Reporter: dairiki | Owner: zzzeek
Type: defect | Status: new
Priority: high | Milestone: 0.8.xx
Component: orm | Severity: minor - half an hour
Resolution: | Keywords:
Progress State: needs tests |
------------------------------+----------------------------------
Comment (by dairiki):
Thanks Mike.
I've tried the above patch on rel_0_8. It does appear to fix the problem
(and the tests pass here too).
(Here's your patch adapted for rel_0_8. It's on util.py rather than
elements.py.)
{{{#!patch
diff --git a/lib/sqlalchemy/sql/util.py b/lib/sqlalchemy/sql/util.py
index 61730f1..2799d8c 100644
--- a/lib/sqlalchemy/sql/util.py
+++ b/lib/sqlalchemy/sql/util.py
@@ -497,7 +497,7 @@ class Annotated(object):
class AnnotatedColumnElement(Annotated):
def __init__(self, element, values):
Annotated.__init__(self, element, values)
- for attr in ('name', 'key'):
+ for attr in ('name', 'key', 'table'):
if self.__dict__.get(attr, False) is None:
self.__dict__.pop(attr)
@@ -512,6 +512,10 @@ class AnnotatedColumnElement(Annotated):
return self._Annotated__element.key
@util.memoized_property
+ def table(self):
+ return self._Annotated__element.table
+
+ @util.memoized_property
def info(self):
return self._Annotated__element.info
}}}
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2813#comment:4>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|