]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
move the definition of sessions public methods closer to the source
authorAnts Aasma <ants.aasma@gmail.com>
Fri, 9 May 2008 17:50:38 +0000 (17:50 +0000)
committerAnts Aasma <ants.aasma@gmail.com>
Fri, 9 May 2008 17:50:38 +0000 (17:50 +0000)
lib/sqlalchemy/orm/scoping.py
lib/sqlalchemy/orm/session.py

index 37cc302977c2437b5302292d2852f78cfcacfb24..c3155c9ef3c6f154352f0352d7a281617e79e12f 100644 (file)
@@ -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):
index 68a3aed68af7144592a7d840abec523c798dda36..440f69ae86ad9d068c5b037436811936007f6be8 100644 (file)
@@ -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.