diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/sqlalchemy/orm/attributes.py | 8 | ||||
| -rw-r--r-- | lib/sqlalchemy/orm/query.py | 2 |
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) |
