summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/elements.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2015-07-19 17:51:26 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2015-07-19 17:51:26 -0400
commit1c65ddee24f77b9751f05ba50b618234a6a039c5 (patch)
treeb024481c9a096ba403f77f8077ad9abee502a4ba /lib/sqlalchemy/sql/elements.py
parentddad19052965b4f1ed75ad0eb33217da18aa81e4 (diff)
parent84e813aee4b47edb5220bc76083525d1ac4e45ba (diff)
downloadsqlalchemy-1c65ddee24f77b9751f05ba50b618234a6a039c5.tar.gz
Merge branch 'bb_issue_3459' of https://bitbucket.org/xflr6/sqlalchemy into pr56
Diffstat (limited to 'lib/sqlalchemy/sql/elements.py')
-rw-r--r--lib/sqlalchemy/sql/elements.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/sqlalchemy/sql/elements.py b/lib/sqlalchemy/sql/elements.py
index eb0923e15..4af1e4463 100644
--- a/lib/sqlalchemy/sql/elements.py
+++ b/lib/sqlalchemy/sql/elements.py
@@ -844,6 +844,13 @@ class ColumnElement(operators.ColumnOperators, ClauseElement):
else:
return False
+ def cast(self, type_):
+ """Produce a type cast, i.e. ``CAST(<expression> AS <type>)``.
+
+ This is a shortcut to the :func:`.cast` function.
+ """
+ return Cast(self, type_)
+
def label(self, name):
"""Produce a column label, i.e. ``<columnname> AS <name>``.