From e80c7cc5c103788a4c7e1c479af2c37cd9c958b3 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sat, 6 Sep 2014 17:56:53 -0400 Subject: wip for #3148 --- lib/sqlalchemy/sql/compiler.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/sqlalchemy/sql/compiler.py') diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index af0fff826..4349c97f4 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -512,7 +512,7 @@ class SQLCompiler(Compiled): selectable = self.stack[-1]['selectable'] try: - col = selectable._inner_column_dict[element.text] + col = selectable._label_resolve_dict[element.text] except KeyError: # treat it like text() util.warn_limited( @@ -701,6 +701,10 @@ class SQLCompiler(Compiled): # here; we can only add a label in the ORDER BY for an individual # label expression in the columns clause. + # TODO: we should see if we can bring _resolve_label + # into this + + raw_col = set(l._order_by_label_element.name for l in order_by_select._raw_columns if l._order_by_label_element is not None) -- cgit v1.2.1