From 4792edd64de945d997e9e0ce191ab44636bda02c Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sat, 13 Jun 2009 03:37:59 +0000 Subject: [PATCH] merged the remainder of r6023 from trunk --- CHANGES | 9 +++++++++ lib/sqlalchemy/orm/query.py | 6 +++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 972d5451a1..9a4596c72f 100644 --- a/CHANGES +++ b/CHANGES @@ -18,6 +18,15 @@ CHANGES wouldn't be deserialized correctly when the whole object was serialized. [ticket:1426] + - Fixed Query being able to join() from individual columns of + a joined-table subclass entity, i.e. + query(SubClass.foo, SubcClass.bar).join(). + In most cases, an error "Could not find a FROM clause to join + from" would be raised. In a few others, the result would be + returned in terms of the base class rather than the subclass - + so applications which relied on this erroneous result need to be + adjusted. [ticket:1431] + - sql - Removed an obscure feature of execute() (including connection, engine, Session) whereby a bindparam() construct can be sent as diff --git a/lib/sqlalchemy/orm/query.py b/lib/sqlalchemy/orm/query.py index d045c7575a..856c9d5f72 100644 --- a/lib/sqlalchemy/orm/query.py +++ b/lib/sqlalchemy/orm/query.py @@ -903,7 +903,7 @@ class Query(object): # after the method completes, # the query's joinpoint will be set to this. right_entity = None - + for arg1 in util.to_list(keys): aliased_entity = False alias_criterion = False @@ -973,6 +973,10 @@ class Query(object): clause = ent.selectable break + # TODO: + # this provides one kind of "backwards join" + # tested in test/orm/query.py. + # remove this in 0.6 if not clause: if isinstance(onclause, interfaces.PropComparator): clause = onclause.__clause_element__() -- 2.47.3