diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-06-03 21:01:20 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-06-03 21:01:20 -0400 |
| commit | 87909841c50d00b40153b1a1181a4acfea070fa8 (patch) | |
| tree | 6627682487c8d105d3cb0f6c482a38515342a73f /lib/sqlalchemy/orm/query.py | |
| parent | 2b0b802b4973e84871d1f266cc2e8aac6c125d17 (diff) | |
| download | sqlalchemy-87909841c50d00b40153b1a1181a4acfea070fa8.tar.gz | |
- pulling out more aliases, sort of
Diffstat (limited to 'lib/sqlalchemy/orm/query.py')
| -rw-r--r-- | lib/sqlalchemy/orm/query.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/sqlalchemy/orm/query.py b/lib/sqlalchemy/orm/query.py index 80fee4a09..69ae5155d 100644 --- a/lib/sqlalchemy/orm/query.py +++ b/lib/sqlalchemy/orm/query.py @@ -1879,16 +1879,21 @@ class Query(object): (right_selectable.description, right_mapper.mapped_table.description)) - if not isinstance(right_selectable, expression.Join): - if not isinstance(right_selectable, expression.Alias): - right_selectable = right_selectable.alias() - + if isinstance(right_selectable, expression.SelectBase): + # TODO: this isn't even covered now! + right_selectable = right_selectable.alias() need_adapter = True + right = aliased(right_mapper, right_selectable) aliased_entity = right_mapper and \ not right_is_aliased and \ ( + # TODO: this produces queries that fail the + # compiler transformation in test_polymorphic_rel + # isinstance(right_mapper._with_polymorphic_selectable, expression.Alias) + + # current right_mapper.with_polymorphic or overlap # test for overlap: |
