From: Mike Bayer Date: Sat, 27 Dec 2008 18:24:00 +0000 (+0000) Subject: - Added ScopedSession.is_active accessor. [ticket:976] X-Git-Tag: rel_0_5_0~65 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f80471e6f385739ee23b96dfe4aa3a48fbc8e1fd;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - Added ScopedSession.is_active accessor. [ticket:976] --- diff --git a/CHANGES b/CHANGES index d1c001ec62..d0c8ff1586 100644 --- a/CHANGES +++ b/CHANGES @@ -51,6 +51,8 @@ CHANGES is blocked and the exception will be reiterated on the next compile() call. This issue occurs frequently when using declarative. + + - Added ScopedSession.is_active accessor. [ticket:976] - Corrected problem with Query.delete() and Query.update() not working properly with bind diff --git a/lib/sqlalchemy/orm/scoping.py b/lib/sqlalchemy/orm/scoping.py index 6e33be96bf..5559784c76 100644 --- a/lib/sqlalchemy/orm/scoping.py +++ b/lib/sqlalchemy/orm/scoping.py @@ -129,7 +129,7 @@ def makeprop(name): def get(self): return getattr(self.registry(), name) return property(get, set) -for prop in ('bind', 'dirty', 'deleted', 'new', 'identity_map'): +for prop in ('bind', 'dirty', 'deleted', 'new', 'identity_map', 'is_active'): setattr(ScopedSession, prop, makeprop(prop)) def clslevel(name): diff --git a/lib/sqlalchemy/orm/session.py b/lib/sqlalchemy/orm/session.py index eb003fda28..3bc3fb4fc2 100644 --- a/lib/sqlalchemy/orm/session.py +++ b/lib/sqlalchemy/orm/session.py @@ -526,7 +526,7 @@ class Session(object): public_methods = ( '__contains__', '__iter__', 'add', 'add_all', 'begin', 'begin_nested', 'clear', 'close', 'commit', 'connection', 'delete', 'execute', 'expire', - 'expire_all', 'expunge', 'flush', 'get_bind', 'is_modified', + 'expire_all', 'expunge', 'flush', 'get_bind', 'is_modified', 'merge', 'query', 'refresh', 'rollback', 'save', 'save_or_update', 'scalar', 'update')