diff options
| author | Ben Fagin <blouis@unquietcode.com> | 2017-06-30 16:36:33 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2017-07-05 15:11:48 -0400 |
| commit | 5c30910759b288d2686a063d1372a33bc6414162 (patch) | |
| tree | ef00604398dda7d180be6b8cd9b26fbce8b1b817 | |
| parent | 7d3da6f850dca54b941275279470c37bec64a48f (diff) | |
| download | sqlalchemy-5c30910759b288d2686a063d1372a33bc6414162.tar.gz | |
Add .autocommit to scoped_session
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
| -rw-r--r-- | doc/build/changelog/changelog_12.rst | 8 | ||||
| -rw-r--r-- | lib/sqlalchemy/orm/scoping.py | 3 |
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)) |
