summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2007-12-31 10:23:21 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2007-12-31 10:23:21 +0000
commit85ab0501f46b473e4283dd2df9f9b74a89ad9021 (patch)
tree7db3829e02260df1cfa72f13ae583ac49fb8fb56 /lib
parent7cc356a7011125ab6cec0834f77b5f0c23992309 (diff)
downloadsqlalchemy-85ab0501f46b473e4283dd2df9f9b74a89ad9021.tar.gz
filter() criterion takes mapper equivalent_columns into account when it adapts to select_table. more to come in [ticket:917] .
Diffstat (limited to 'lib')
-rw-r--r--lib/sqlalchemy/orm/query.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/sqlalchemy/orm/query.py b/lib/sqlalchemy/orm/query.py
index dd7fa638e..83065a73d 100644
--- a/lib/sqlalchemy/orm/query.py
+++ b/lib/sqlalchemy/orm/query.py
@@ -929,8 +929,10 @@ class Query(object):
# be adapted to be relative to the user-supplied selectable.
adapt_criterion = self.table not in self._get_joinable_tables()
+ # adapt for poylmorphic mapper
+ # TODO: generalize the polymorphic mapper adaption to that of the select_from() adaption
if not adapt_criterion and whereclause is not None and (self.mapper is not self.select_mapper):
- whereclause = sql_util.ClauseAdapter(from_obj).traverse(whereclause)
+ whereclause = sql_util.ClauseAdapter(from_obj, equivalents=self.select_mapper._get_equivalent_columns()).traverse(whereclause)
# TODO: mappers added via add_entity(), adapt their queries also,
# if those mappers are polymorphic