From d1475d02c74daea63e0b6772e78d2ac67ce80639 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Fri, 10 Oct 2014 17:17:34 -0400 Subject: [PATCH] - fix the marker here so this page can be found - clarify the note about the defaults, note that it's upcoming in 1.0 --- doc/build/core/defaults.rst | 3 ++- lib/sqlalchemy/sql/dml.py | 10 ++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/doc/build/core/defaults.rst b/doc/build/core/defaults.rst index 166273c186..7b426cf746 100644 --- a/doc/build/core/defaults.rst +++ b/doc/build/core/defaults.rst @@ -1,6 +1,7 @@ +.. module:: sqlalchemy.schema + .. _metadata_defaults_toplevel: .. _metadata_defaults: -.. module:: sqlalchemy.schema Column Insert/Update Defaults ============================== diff --git a/lib/sqlalchemy/sql/dml.py b/lib/sqlalchemy/sql/dml.py index 62be3a2865..910806ebbe 100644 --- a/lib/sqlalchemy/sql/dml.py +++ b/lib/sqlalchemy/sql/dml.py @@ -516,10 +516,12 @@ class Insert(ValuesBase): .. note:: - A SELECT..INSERT construct in SQL has no VALUES clause. Therefore - :class:`.Column` objects which utilize Python-side defaults - (e.g. as described at :ref:`metadata_defaults_toplevel`) - will **not** take effect when using :meth:`.Insert.from_select`. + Python-side and SQL function defaults, as described at + :ref:`metadata_defaults_toplevel`, are **not** automatically + included in the SELECT statement as rendered unless explicitly + added to the statement. The behavior of automatically rendering + these default values and expressions is available as of SQLAlchemy + version 1.0.0. .. versionadded:: 0.8.3 -- 2.47.3