From 84e813aee4b47edb5220bc76083525d1ac4e45ba Mon Sep 17 00:00:00 2001 From: Sebastian Bank Date: Fri, 19 Jun 2015 17:37:21 +0200 Subject: add ClauseElement.cast() shortcut-method --- lib/sqlalchemy/sql/elements.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/sqlalchemy/sql/elements.py') diff --git a/lib/sqlalchemy/sql/elements.py b/lib/sqlalchemy/sql/elements.py index 27ecce2b0..5df736ac7 100644 --- a/lib/sqlalchemy/sql/elements.py +++ b/lib/sqlalchemy/sql/elements.py @@ -837,6 +837,13 @@ class ColumnElement(operators.ColumnOperators, ClauseElement): else: return False + def cast(self, type_): + """Produce a type cast, i.e. ``CAST( AS )``. + + This is a shortcut to the :func:`.cast` function. + """ + return Cast(self, type_) + def label(self, name): """Produce a column label, i.e. `` AS ``. -- cgit v1.2.1