]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Add .autocommit to scoped_session
authorBen Fagin <blouis@unquietcode.com>
Fri, 30 Jun 2017 20:36:33 +0000 (16:36 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 5 Jul 2017 19:11:48 +0000 (15:11 -0400)
Added ``.autocommit`` attribute to :class:`.scoped_session`, proxying
the ``.autocommit`` attribute of the underling :class:`.Session`
currently assigned to the thread.  Pull request courtesy
Ben Fagin.

Change-Id: Iff741978bd67762f4c7375a23cc151b26192042b
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/372

doc/build/changelog/changelog_12.rst
lib/sqlalchemy/orm/scoping.py

index 0c3e3b5db076e50aef8cec9eca51aa8d8054651c..34e82504b3192e5edda3014751d6f6679fbb467b 100644 (file)
 .. changelog::
     :version: 1.2.0b1
 
+    .. change:: scoped_autocommit
+        :tags: feature, orm
+
+        Added ``.autocommit`` attribute to :class:`.scoped_session`, proxying
+        the ``.autocommit`` attribute of the underling :class:`.Session`
+        currently assigned to the thread.  Pull request courtesy
+        Ben Fagin.
+
     .. change:: 4009
         :tags: feature, mysql
         :tickets: 4009
index 055ec7d6a19d38dc7dd37b5be7639dd180089c3d..94a3b40d619a4a2cc5d0f5e3887e23db4177d8b2 100644 (file)
@@ -167,7 +167,8 @@ def makeprop(name):
     return property(get, set)
 
 for prop in ('bind', 'dirty', 'deleted', 'new', 'identity_map',
-             'is_active', 'autoflush', 'no_autoflush', 'info'):
+             'is_active', 'autoflush', 'no_autoflush', 'info',
+             'autocommit'):
     setattr(scoped_session, prop, makeprop(prop))