summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/elements.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2019-07-04 11:16:50 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2019-07-04 11:16:50 -0400
commite03f7ab50e69ffce67585cdc7a0cb7a3cc5c0cc1 (patch)
treec4456ad810910fa3ad841f74934c80f2eb005013 /lib/sqlalchemy/sql/elements.py
parent9b52c8ae927ae2628dcc1763d2e31245285f4d88 (diff)
downloadsqlalchemy-e03f7ab50e69ffce67585cdc7a0cb7a3cc5c0cc1.tar.gz
Add tutorial section for cast(), type_coerce()
Change-Id: I49f635f0ad4d07abe8ef2681c9660ec7fcf5f99b
Diffstat (limited to 'lib/sqlalchemy/sql/elements.py')
-rw-r--r--lib/sqlalchemy/sql/elements.py26
1 files changed, 24 insertions, 2 deletions
diff --git a/lib/sqlalchemy/sql/elements.py b/lib/sqlalchemy/sql/elements.py
index 22799dab5..b902ef4b4 100644
--- a/lib/sqlalchemy/sql/elements.py
+++ b/lib/sqlalchemy/sql/elements.py
@@ -859,6 +859,14 @@ class ColumnElement(
This is a shortcut to the :func:`~.expression.cast` function.
+ .. seealso::
+
+ :ref:`coretutorial_casts`
+
+ :func:`~.expression.cast`
+
+ :func:`~.expression.type_coerce`
+
.. versionadded:: 1.0.7
"""
@@ -2458,8 +2466,14 @@ class Cast(ColumnElement):
.. seealso::
+ :ref:`coretutorial_casts`
+
:func:`.cast`
+ :func:`.type_coerce` - an alternative to CAST that coerces the type
+ on the Python side only, which is often sufficient to generate the
+ correct SQL and data coercion.
+
"""
__visit_name__ = "cast"
@@ -2509,8 +2523,12 @@ class Cast(ColumnElement):
.. seealso::
- :func:`.type_coerce` - Python-side type coercion without emitting
- CAST.
+ :ref:`coretutorial_casts`
+
+ :func:`.type_coerce` - an alternative to CAST that coerces the type
+ on the Python side only, which is often sufficient to generate the
+ correct SQL and data coercion.
+
"""
self.type = type_api.to_instance(type_)
@@ -2552,6 +2570,8 @@ class TypeCoerce(ColumnElement):
:func:`.expression.type_coerce`
+ :func:`.cast`
+
"""
__visit_name__ = "type_coerce"
@@ -2614,6 +2634,8 @@ class TypeCoerce(ColumnElement):
.. seealso::
+ :ref:`coretutorial_casts`
+
:func:`.cast`
"""