summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnts Aasma <ants.aasma@gmail.com>2008-05-09 17:50:38 +0000
committerAnts Aasma <ants.aasma@gmail.com>2008-05-09 17:50:38 +0000
commit54296c962870821dfbe3c69b2eadd4e1c37e36db (patch)
treef3d64381577d09112ad26e5d589fe079f16ac05d
parent42bfd060a00d899850594e4f1095ca951bea423e (diff)
downloadsqlalchemy-54296c962870821dfbe3c69b2eadd4e1c37e36db.tar.gz
move the definition of sessions public methods closer to the source
-rw-r--r--lib/sqlalchemy/orm/scoping.py2
-rw-r--r--lib/sqlalchemy/orm/session.py2
2 files changed, 3 insertions, 1 deletions
diff --git a/lib/sqlalchemy/orm/scoping.py b/lib/sqlalchemy/orm/scoping.py
index 37cc30297..c3155c9ef 100644
--- a/lib/sqlalchemy/orm/scoping.py
+++ b/lib/sqlalchemy/orm/scoping.py
@@ -106,7 +106,7 @@ def instrument(name):
def do(self, *args, **kwargs):
return getattr(self.registry(), name)(*args, **kwargs)
return do
-for meth in ('get', 'load', 'close', 'add', 'add_all', 'expire_all', 'save', 'commit', 'update', 'save_or_update', 'flush', 'query', 'delete', 'merge', 'clear', 'refresh', 'expire', 'expunge', 'rollback', 'begin', 'begin_nested', 'connection', 'execute', 'scalar', 'get_bind', 'is_modified', '__contains__', '__iter__'):
+for meth in Session.public_methods:
setattr(ScopedSession, meth, instrument(meth))
def makeprop(name):
diff --git a/lib/sqlalchemy/orm/session.py b/lib/sqlalchemy/orm/session.py
index 68a3aed68..440f69ae8 100644
--- a/lib/sqlalchemy/orm/session.py
+++ b/lib/sqlalchemy/orm/session.py
@@ -479,6 +479,8 @@ class Session(object):
a thread-managed Session adapter, provided by the [sqlalchemy.orm#scoped_session()] function.
"""
+ public_methods = ('get', 'load', 'close', 'add', 'add_all', 'expire_all', 'save', 'commit', 'update', 'save_or_update', 'flush', 'query', 'delete', 'merge', 'clear', 'refresh', 'expire', 'expunge', 'rollback', 'begin', 'begin_nested', 'connection', 'execute', 'scalar', 'get_bind', 'is_modified', '__contains__', '__iter__')
+
def __init__(self, bind=None, autoflush=True, autoexpire=True, autocommit=False, twophase=False, echo_uow=False, weak_identity_map=True, binds=None, extension=None):
"""Construct a new Session.