From f122a307e03d9a1f2322b35429972a5f928d5b30 Mon Sep 17 00:00:00 2001 From: Luke Cyca Date: Thu, 7 Mar 2013 11:56:11 -0800 Subject: Changed behavior of Select.correlate() to ignore correlations to froms that don't exist in the superquery. --- lib/sqlalchemy/sql/compiler.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'lib/sqlalchemy/sql/compiler.py') diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index 59e46de12..90e906727 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -1086,14 +1086,9 @@ class SQLCompiler(engine.Compiled): positional_names=None, **kwargs): entry = self.stack and self.stack[-1] or {} - if not asfrom: - existingfroms = entry.get('from', None) - else: - # don't render correlations if we're rendering a FROM list - # entry - existingfroms = [] + existingfroms = entry.get('from', None) - froms = select._get_display_froms(existingfroms) + froms = select._get_display_froms(existingfroms, asfrom=asfrom) correlate_froms = set(sql._from_objects(*froms)) -- cgit v1.2.1