diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-02-25 14:38:00 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-02-25 14:38:00 -0500 |
commit | aa70505df582e29bc857d9e10c60c7a1cbcc0f68 (patch) | |
tree | 0174e5368840e898eb2d47319e8436fc2e5f1753 | |
parent | deb7e76a42fac9995174f30baa365b4d03ddee3c (diff) | |
download | sqlalchemy-aa70505df582e29bc857d9e10c60c7a1cbcc0f68.tar.gz |
plus add it to the scoping namespace
-rw-r--r-- | lib/sqlalchemy/orm/scoping.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/sqlalchemy/orm/scoping.py b/lib/sqlalchemy/orm/scoping.py index ffc8ef4a1..3c1cd7f26 100644 --- a/lib/sqlalchemy/orm/scoping.py +++ b/lib/sqlalchemy/orm/scoping.py @@ -41,8 +41,9 @@ class ScopedSession(object): scope = kwargs.pop('scope', False) if scope is not None: if self.registry.has(): - raise sa_exc.InvalidRequestError("Scoped session is already present; " - "no new arguments may be specified.") + raise sa_exc.InvalidRequestError( + "Scoped session is already present; " + "no new arguments may be specified.") else: sess = self.session_factory(**kwargs) self.registry.set(sess) @@ -70,8 +71,8 @@ class ScopedSession(object): self.session_factory.configure(**kwargs) def query_property(self, query_cls=None): - """return a class property which produces a `Query` object against the - class when called. + """return a class property which produces a `Query` object + against the class when called. e.g.:: @@ -121,7 +122,8 @@ def makeprop(name): def get(self): return getattr(self.registry(), name) return property(get, set) -for prop in ('bind', 'dirty', 'deleted', 'new', 'identity_map', 'is_active', 'autoflush'): +for prop in ('bind', 'dirty', 'deleted', 'new', 'identity_map', + 'is_active', 'autoflush', 'no_autoflush'): setattr(ScopedSession, prop, makeprop(prop)) def clslevel(name): |