From 20e3df602846bb1d8940b5138f21ef203c99bade Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Thu, 30 Apr 2015 12:53:27 -0400 Subject: - Fixed regression from as yet unreleased 0.9.10 where the new addition of ``entity`` to the :attr:`.Query.column_descriptions` accessor would fail if the target entity was produced from a core selectable such as a :class:`.Table` or :class:`.CTE` object. fixes #3403 references #3320 --- lib/sqlalchemy/orm/query.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/sqlalchemy/orm/query.py') diff --git a/lib/sqlalchemy/orm/query.py b/lib/sqlalchemy/orm/query.py index c3638f66d..f4b04b078 100644 --- a/lib/sqlalchemy/orm/query.py +++ b/lib/sqlalchemy/orm/query.py @@ -2577,6 +2577,7 @@ class Query(object): 'expr': ent.expr, 'entity': ent.entity_zero.entity if ent.entity_zero is not None + and not inspect(ent.entity_zero).is_selectable else None } for ent in self._entities @@ -3620,7 +3621,6 @@ class _ColumnEntity(_QueryEntity): if 'parententity' in elem._annotations and actual_froms.intersection(elem._from_objects) ]) - if self.entities: self.entity_zero = self.entities[0] elif self.namespace is not None: -- cgit v1.2.1