summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormike bayer <mike_mp@zzzcomputing.com>2017-07-05 16:23:57 -0400
committerGerrit Code Review <gerrit@awstats.zzzcomputing.com>2017-07-05 16:23:57 -0400
commit35ab498a87398e537594a639145bfbba74795476 (patch)
tree445465ec5941531c9a11910c79a9c1562288bec8
parentb7a51f3a9c90c577e315bc0c3881b4c7623450e2 (diff)
parent5c30910759b288d2686a063d1372a33bc6414162 (diff)
downloadsqlalchemy-35ab498a87398e537594a639145bfbba74795476.tar.gz
Merge "Add .autocommit to scoped_session"
-rw-r--r--doc/build/changelog/changelog_12.rst8
-rw-r--r--lib/sqlalchemy/orm/scoping.py3
2 files changed, 10 insertions, 1 deletions
diff --git a/doc/build/changelog/changelog_12.rst b/doc/build/changelog/changelog_12.rst
index 0c3e3b5db..34e82504b 100644
--- a/doc/build/changelog/changelog_12.rst
+++ b/doc/build/changelog/changelog_12.rst
@@ -13,6 +13,14 @@
.. 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
diff --git a/lib/sqlalchemy/orm/scoping.py b/lib/sqlalchemy/orm/scoping.py
index 055ec7d6a..94a3b40d6 100644
--- a/lib/sqlalchemy/orm/scoping.py
+++ b/lib/sqlalchemy/orm/scoping.py
@@ -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))