]> git.decadent.org.uk Git - dak.git/commitdiff
Add doc for session_wrapper.
authorChris Lamb <lamby@debian.org>
Tue, 27 Oct 2009 08:55:06 +0000 (08:55 +0000)
committerChris Lamb <lamby@debian.org>
Tue, 27 Oct 2009 13:44:13 +0000 (13:44 +0000)
Signed-off-by: Chris Lamb <lamby@debian.org>
daklib/dbconn.py

index 8ee9076874d09a0d785924cb4bf3eb891e9b41b9..fb322aeaf674e22fa455c6af95c84e004f8d8f78 100755 (executable)
@@ -59,6 +59,12 @@ __all__ = ['IntegrityError', 'SQLAlchemyError']
 ################################################################################
 
 def session_wrapper(fn):
+    """
+    Wrapper around common ".., session=None):" handling. If the wrapped
+    function is called without passing 'session', we create a local one
+    and destroy it when the function ends.
+    """
+
     def wrapped(*args, **kwargs):
         private_transaction = False
         session = kwargs.get('session')