summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2009-01-12 15:58:09 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2009-01-12 15:58:09 +0000
commit68c247358b2905b6992fa7fe935e80b7f41b36d6 (patch)
tree3784f441af27fe50ca397bda5c8d996dfd748d89 /lib
parentfd3b037e523e24eb5aa357d62ac9631ee91cf3a0 (diff)
downloadsqlalchemy-68c247358b2905b6992fa7fe935e80b7f41b36d6.tar.gz
Ensure RowTuple names are correct by adding "key" to QueryableAttribute.
Diffstat (limited to 'lib')
-rw-r--r--lib/sqlalchemy/orm/attributes.py8
-rw-r--r--lib/sqlalchemy/orm/query.py2
2 files changed, 3 insertions, 7 deletions
diff --git a/lib/sqlalchemy/orm/attributes.py b/lib/sqlalchemy/orm/attributes.py
index 1606f8267..d7c2e8772 100644
--- a/lib/sqlalchemy/orm/attributes.py
+++ b/lib/sqlalchemy/orm/attributes.py
@@ -99,7 +99,7 @@ class QueryableAttribute(interfaces.PropComparator):
comparator
a sql.Comparator to which class-level compare/math events will be sent
"""
-
+ self.key = key
self.impl = impl
self.comparator = comparator
self.parententity = parententity
@@ -182,7 +182,7 @@ def proxied_attribute_factory(descriptor):
self._parententity = parententity
self.impl = _ProxyImpl(key)
- @property
+ @util.memoized_property
def comparator(self):
if util.callable(self._comparator):
self._comparator = self._comparator()
@@ -218,10 +218,6 @@ def proxied_attribute_factory(descriptor):
attribute)
)
- def _property(self):
- return self._parententity.get_property(self.key, resolve_synonyms=True)
- property = property(_property)
-
Proxy.__name__ = type(descriptor).__name__ + 'Proxy'
util.monkeypatch_proxied_specials(Proxy, type(descriptor),
diff --git a/lib/sqlalchemy/orm/query.py b/lib/sqlalchemy/orm/query.py
index f225f346a..e540ce21e 100644
--- a/lib/sqlalchemy/orm/query.py
+++ b/lib/sqlalchemy/orm/query.py
@@ -1823,7 +1823,7 @@ class _ColumnEntity(_QueryEntity):
column = sql.literal_column(column)
self._result_label = column.name
elif isinstance(column, attributes.QueryableAttribute):
- self._result_label = column.property.key
+ self._result_label = column.key
column = column.__clause_element__()
else:
self._result_label = getattr(column, 'key', None)