summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/base.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2014-07-24 14:33:50 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2014-07-24 14:33:50 -0400
commit0df977ccad63831375d8a7bc6383385c331d9742 (patch)
tree18d5f67dd70a7fb8090e230b7f86e2c3eece7c26 /lib/sqlalchemy/sql/base.py
parent07c01b77f16a08cecdad2c80c1283bed46a7f815 (diff)
downloadsqlalchemy-0df977ccad63831375d8a7bc6383385c331d9742.tar.gz
- Added a supported :meth:`.FunctionElement.alias` method to functions,
e.g. the ``func`` construct. Previously, behavior for this method was undefined. The current behavior mimics that of pre-0.9.4, which is that the function is turned into a single-column FROM clause with the given alias name, where the column itself is anonymously named. fixes #3137
Diffstat (limited to 'lib/sqlalchemy/sql/base.py')
-rw-r--r--lib/sqlalchemy/sql/base.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/sqlalchemy/sql/base.py b/lib/sqlalchemy/sql/base.py
index 5358d95b5..2d06109b9 100644
--- a/lib/sqlalchemy/sql/base.py
+++ b/lib/sqlalchemy/sql/base.py
@@ -449,10 +449,12 @@ class ColumnCollection(util.OrderedProperties):
"""
- def __init__(self):
+ def __init__(self, *columns):
super(ColumnCollection, self).__init__()
self.__dict__['_all_col_set'] = util.column_set()
self.__dict__['_all_columns'] = []
+ for c in columns:
+ self.add(c)
def __str__(self):
return repr([str(c) for c in self])