diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-06-03 15:38:08 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-06-03 15:38:08 -0400 |
commit | f8325d9dbb52d0da140f3403ce915645ae4a5a9c (patch) | |
tree | ee1bb969dc9f6ae28fadd2258081a55bf257af91 /lib/sqlalchemy/sql/compiler.py | |
parent | 84c42d9c64f4537935315e8c35f497e3300021a8 (diff) | |
download | sqlalchemy-f8325d9dbb52d0da140f3403ce915645ae4a5a9c.tar.gz |
- add changelog/migration note
- inline the label check
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
-rw-r--r-- | lib/sqlalchemy/sql/compiler.py | 18 |
1 files changed, 9 insertions, 9 deletions
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) |