diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-06-04 18:23:06 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-06-04 18:23:06 -0400 |
commit | 11578ba709ff3e5f2a2a2a9f92bf6fdc2ee6d328 (patch) | |
tree | 4202758c520dd62e85f18dc37da60d5774d375c8 /lib/sqlalchemy/orm/relationships.py | |
parent | 58e917fe2de2f4b643f3bf2468f51aef27e67747 (diff) | |
download | sqlalchemy-11578ba709ff3e5f2a2a2a9f92bf6fdc2ee6d328.tar.gz |
- improve overlapping selectables, apply to both query and relationship
- clean up inspect() calls within query._join()
- make sure join.alias(flat) propagates
- fix almost all assertion tests
Diffstat (limited to 'lib/sqlalchemy/orm/relationships.py')
-rw-r--r-- | lib/sqlalchemy/orm/relationships.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/sqlalchemy/orm/relationships.py b/lib/sqlalchemy/orm/relationships.py index 95fa28613..33377d3ec 100644 --- a/lib/sqlalchemy/orm/relationships.py +++ b/lib/sqlalchemy/orm/relationships.py @@ -17,7 +17,7 @@ from .. import sql, util, exc as sa_exc, schema from ..sql.util import ( ClauseAdapter, join_condition, _shallow_annotate, visit_binary_product, - _deep_deannotate, find_tables + _deep_deannotate, find_tables, selectables_overlap ) from ..sql import operators, expression, visitors from .interfaces import MANYTOMANY, MANYTOONE, ONETOMANY @@ -404,11 +404,7 @@ class JoinCondition(object): def _tables_overlap(self): """Return True if parent/child tables have some overlap.""" - return bool( - set(find_tables(self.parent_selectable)).intersection( - find_tables(self.child_selectable) - ) - ) + return selectables_overlap(self.parent_selectable, self.child_selectable) def _annotate_remote(self): """Annotate the primaryjoin and secondaryjoin |