summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/query.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2010-01-11 20:26:34 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2010-01-11 20:26:34 +0000
commit7fedc9298ace22df69d030c4d97169528f09f662 (patch)
treeb06e401ee36cab06a418d3510034b9ae7ad6d1f7 /lib/sqlalchemy/orm/query.py
parent513b350ccc48009aa32f5c275f3f6aacde8b8462 (diff)
downloadsqlalchemy-7fedc9298ace22df69d030c4d97169528f09f662.tar.gz
have paths represented as their actual mapper, not the base mapper, allowing
more information for custom mapper opts to see what's going on. add a new _reduce_path() function to apply to the path as stored in dictionaries, adds a slight cost overhead.
Diffstat (limited to 'lib/sqlalchemy/orm/query.py')
-rw-r--r--lib/sqlalchemy/orm/query.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/sqlalchemy/orm/query.py b/lib/sqlalchemy/orm/query.py
index 5b2fbb524..c90c163e9 100644
--- a/lib/sqlalchemy/orm/query.py
+++ b/lib/sqlalchemy/orm/query.py
@@ -1967,7 +1967,7 @@ class _MapperEntity(_QueryEntity):
if is_aliased_class:
self.path_entity = self.entity = self.entity_zero = entity
else:
- self.path_entity = mapper.base_mapper
+ self.path_entity = mapper
self.entity = self.entity_zero = mapper
def set_with_polymorphic(self, query, cls_or_mappers, selectable, discriminator):
@@ -1989,7 +1989,7 @@ class _MapperEntity(_QueryEntity):
if _is_aliased_class(entity):
return entity is self.path_entity
else:
- return entity.base_mapper is self.path_entity
+ return entity.isa(self.path_entity)
def adapt_to_selectable(self, query, sel):
query._entities.append(self)
@@ -2151,7 +2151,7 @@ class _ColumnEntity(_QueryEntity):
return entity is self.entity_zero
else:
return not _is_aliased_class(self.entity_zero) and \
- entity.base_mapper.common_parent(self.entity_zero)
+ entity.common_parent(self.entity_zero)
def _resolve_expr_against_query_aliases(self, query, expr, context):
return query._adapt_clause(expr, False, True)