]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
mention no_autoflush in the flush section of the docs
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 8 Feb 2019 22:48:51 +0000 (17:48 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 8 Feb 2019 22:50:13 +0000 (17:50 -0500)
also remove link to wiki which is obsolete

Change-Id: I9ebd578923c3eba6e35f3b6203c01ba003dd4115
(cherry picked from commit fcb5dbf39569bcacb70a3fed05f469d73b64f116)

doc/build/orm/session_basics.rst

index 4547e124361901ebb530980274b724bf48a915b3..a4c82e6f1e6ed67d289681693eeebc089561af07 100644 (file)
@@ -714,8 +714,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