diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-07-15 09:59:17 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-07-15 09:59:17 -0400 |
| commit | 2bd3c795cfe39249aceb6b04ea4650a17788d9b6 (patch) | |
| tree | c097a193f5632e6c9576af95fea198925ed450c4 /lib | |
| parent | 10db67be5b783b94b59dd7cf039f8c322cf837c8 (diff) | |
| download | sqlalchemy-2bd3c795cfe39249aceb6b04ea4650a17788d9b6.tar.gz | |
- Column-entities (i.e. query(Foo.id)) copy theirrel_0_6_3
state more fully when queries are derived from
themselves + a selectable (i.e. from_self(),
union(), etc.), so that join() and such have the
correct state to work from. [ticket:1853]
- Fixed bug where Query.join() would fail if
querying a non-ORM column then joining without
an on clause when a FROM clause is already
present, now raises a checked exception the
same way it does when the clause is not
present. [ticket:1853]
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/sqlalchemy/orm/query.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/sqlalchemy/orm/query.py b/lib/sqlalchemy/orm/query.py index 28ddc1f13..3f8300a09 100644 --- a/lib/sqlalchemy/orm/query.py +++ b/lib/sqlalchemy/orm/query.py @@ -1301,7 +1301,7 @@ class Query(object): join_to_left = not is_aliased_class and not left_is_aliased - if self._from_obj: + if self._from_obj and left_selectable is not None: replace_clause_index, clause = sql_util.find_join_source( self._from_obj, left_selectable) @@ -2622,7 +2622,9 @@ class _ColumnEntity(_QueryEntity): return self.column.type def adapt_to_selectable(self, query, sel): - _ColumnEntity(query, sel.corresponding_column(self.column)) + c = _ColumnEntity(query, sel.corresponding_column(self.column)) + c.entity_zero = self.entity_zero + c.entities = self.entities def setup_entity(self, entity, mapper, adapter, from_obj, is_aliased_class, with_polymorphic): |
