summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2019-02-08 17:48:51 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2019-02-08 17:50:19 -0500
commit48889aae38ae5a995b965089b066023db0a0573b (patch)
tree9e2e8c753de5779645f4a2f88c9997dbd7f829e1
parentec85b5b7be0023080ab00f1f7c54aa93bbd2506a (diff)
downloadsqlalchemy-48889aae38ae5a995b965089b066023db0a0573b.tar.gz
mention no_autoflush in the flush section of the docs
also remove link to wiki which is obsolete Change-Id: I9ebd578923c3eba6e35f3b6203c01ba003dd4115 (cherry picked from commit fcb5dbf39569bcacb70a3fed05f469d73b64f116)
-rw-r--r--doc/build/orm/session_basics.rst7
1 files changed, 5 insertions, 2 deletions
diff --git a/doc/build/orm/session_basics.rst b/doc/build/orm/session_basics.rst
index 06cd23bd2..20511d9fe 100644
--- a/doc/build/orm/session_basics.rst
+++ b/doc/build/orm/session_basics.rst
@@ -649,8 +649,11 @@ Additionally, autoflush can be temporarily disabled by setting the
mysession = Session()
mysession.autoflush = False
-Some autoflush-disable recipes are available at `DisableAutoFlush
-<http://www.sqlalchemy.org/trac/wiki/UsageRecipes/DisableAutoflush>`_.
+More conveniently, it can be turned off within a context managed block using :attr:`.Session.no_autoflush`::
+
+ with mysession.no_autoflush:
+ mysession.add(some_object)
+ mysession.flush()
The flush process *always* occurs within a transaction, even if the
:class:`~sqlalchemy.orm.session.Session` has been configured with