From 515811eb582cc6d44513e19af66bf8376fd541bd Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sat, 18 Aug 2012 00:54:00 -0400 Subject: - fix the labeled column with column_expression() issue, finishes [ticket:1534] - epic documentation sweep for new operator system, making ORM links consistent and complete, full documentation and examples for type/SQL expression feature - type_coerce() explicitly accepts BindParamClause objects - change UserDefinedType to coerce the other side to itself by default as this is much more likely what's desired - make coerce_compared_type() fully public on all types - have profiling run the test no matter what so that the test_zoomarks don't fail when callcounts are missing --- lib/sqlalchemy/sql/compiler.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'lib/sqlalchemy/sql/compiler.py') diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index f975225d6..49df9322e 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -948,8 +948,15 @@ class SQLCompiler(engine.Compiled): else: add_to_result_map = None - if isinstance(col_expr, sql.Label): - result_expr = col_expr + if isinstance(column, sql.Label): + if col_expr is not column: + result_expr = _CompileLabel( + col_expr, + column.name, + alt_names=(column.element,) + ) + else: + result_expr = col_expr elif select is not None and \ select.use_labels and \ -- cgit v1.2.1