]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
add anonymous labels to function calls
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 4 Jan 2008 01:00:42 +0000 (01:00 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 4 Jan 2008 01:00:42 +0000 (01:00 +0000)
lib/sqlalchemy/sql/compiler.py

index 9e8b0f488076914e1c64a87a69c30d4220c2d637..35a12efe393071af82dd72c531046baf283ba923 100644 (file)
@@ -463,7 +463,7 @@ class DefaultCompiler(engine.Compiled):
             column.table is not None and \
             not isinstance(column.table, sql.Select):
             return column.label(column.name)
-        elif not isinstance(column, (sql._UnaryExpression, sql._TextClause)) and not hasattr(column, 'name'):
+        elif not isinstance(column, (sql._UnaryExpression, sql._TextClause)) and (not hasattr(column, 'name') or isinstance(column, sql._Function)):
             return column.label(None)
         else:
             return column