From f8325d9dbb52d0da140f3403ce915645ae4a5a9c Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Mon, 3 Jun 2013 15:38:08 -0400 Subject: - add changelog/migration note - inline the label check --- lib/sqlalchemy/sql/compiler.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'lib/sqlalchemy/sql/compiler.py') diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index d475f54ac..73b094053 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -516,7 +516,9 @@ class SQLCompiler(engine.Compiled): def visit_clauselist(self, clauselist, order_by_select=None, **kw): if order_by_select is not None: - return self._order_by_clauselist(clauselist, order_by_select, **kw) + return self._order_by_clauselist( + clauselist, order_by_select, **kw) + sep = clauselist.operator if sep is None: sep = " " @@ -538,19 +540,17 @@ class SQLCompiler(engine.Compiled): 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) - def label_ok(c): - if c._order_by_label_element is not None and \ - c._order_by_label_element.name in raw_col: - return c._order_by_label_element - else: - return None return ", ".join( s for s in ( c._compiler_dispatch(self, - render_label_as_label=label_ok(c), - **kw) + render_label_as_label= + c._order_by_label_element if + c._order_by_label_element is not None and + c._order_by_label_element.name in raw_col + else None, + **kw) for c in clauselist.clauses) if s) -- cgit v1.2.1