From 5c30910759b288d2686a063d1372a33bc6414162 Mon Sep 17 00:00:00 2001 From: Ben Fagin Date: Fri, 30 Jun 2017 16:36:33 -0400 Subject: 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 --- lib/sqlalchemy/orm/scoping.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/sqlalchemy/orm') 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)) -- cgit v1.2.1