Re: [Sqlalchemy-tickets] [sqlalchemy] #2587: flatten joined-inheritance join targets on individual
Brought to you by:
zzzeek
|
From: sqlalchemy <mi...@zz...> - 2013-05-31 19:40:00
|
#2587: flatten joined-inheritance join targets on individual tables
------------------------------+---------------------------------------
Reporter: zzzeek | Owner: zzzeek
Type: enhancement | Status: new
Priority: medium | Milestone: 0.9.0
Component: orm | Severity: very major - up to 2 days
Resolution: | Keywords:
Progress State: in queue |
------------------------------+---------------------------------------
Comment (by zzzeek):
how to make query(A).join(A.joinedinh) work:
{{{
#!diff
diff --git a/lib/sqlalchemy/orm/query.py b/lib/sqlalchemy/orm/query.py
index 79fd61c..3d7f376 100644
--- a/lib/sqlalchemy/orm/query.py
+++ b/lib/sqlalchemy/orm/query.py
@@ -1871,10 +1871,7 @@ class Query(object):
aliased_entity = right_mapper and \
not right_is_aliased and \
(
- right_mapper.with_polymorphic or
- isinstance(
- right_mapper.mapped_table,
- expression.Join)
+ right_mapper.with_polymorphic
)
if not need_adapter and (create_aliases or aliased_entity):
diff --git a/lib/sqlalchemy/sql/expression.py
b/lib/sqlalchemy/sql/expression.py
index 5820cb1..b95cf14 100644
--- a/lib/sqlalchemy/sql/expression.py
+++ b/lib/sqlalchemy/sql/expression.py
@@ -4215,7 +4215,8 @@ class FromGrouping(FromClause):
# this could be
# self.element.foreign_keys
# see SelectableTest.test_join_condition
- return set()
+ return self.element.foreign_keys
+# return set()
@property
def _hide_froms(self):
}}}
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2587#comment:6>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|