summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/query.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2014-06-30 20:25:04 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2014-06-30 20:25:04 -0400
commit2d8d1dcf60e023275b8dcfea015ec16cad69d266 (patch)
tree3a53a49ffaf72a955af4c1005888b76c3f9f6c8b /lib/sqlalchemy/orm/query.py
parent4b6d6d5f8024e2192c4383a0c4a3dd459900ff1a (diff)
downloadsqlalchemy-2d8d1dcf60e023275b8dcfea015ec16cad69d266.tar.gz
- repair the _enable_single_crit method, it was named the same
as the attribute and probably just replaced itself, so that is now _set_enable_single_crit - as a side effect of the main issue fixed here, correct the case in adjust_for_single_inheritance where the same mapper appears more than once in mapper_adapter_map; run through a set() for uniqueness. - Fixed bug in subquery eager loading in conjunction with :func:`.with_polymorphic`, the targeting of entities and columns in the subquery load has been made more accurate with respect to this type of entity and others. Fixes #3106
Diffstat (limited to 'lib/sqlalchemy/orm/query.py')
-rw-r--r--lib/sqlalchemy/orm/query.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/sqlalchemy/orm/query.py b/lib/sqlalchemy/orm/query.py
index 5d60c4e29..728f7787a 100644
--- a/lib/sqlalchemy/orm/query.py
+++ b/lib/sqlalchemy/orm/query.py
@@ -941,7 +941,7 @@ class Query(object):
"""
fromclause = self.with_labels().enable_eagerloads(False).\
- _enable_single_crit(False).\
+ _set_enable_single_crit(False).\
statement.correlate(None)
q = self._from_selectable(fromclause)
if entities:
@@ -949,7 +949,7 @@ class Query(object):
return q
@_generative()
- def _enable_single_crit(self, val):
+ def _set_enable_single_crit(self, val):
self._enable_single_crit = val
@_generative()
@@ -2908,7 +2908,8 @@ class Query(object):
subtypes are selected from the total results.
"""
- for (ext_info, adapter) in self._mapper_adapter_map.values():
+
+ for (ext_info, adapter) in set(self._mapper_adapter_map.values()):
if ext_info in self._join_entities:
continue
single_crit = ext_info.mapper._single_table_criterion