From a44e7de5fff597b9c2e04de3d22ae57422060f65 Mon Sep 17 00:00:00 2001 From: Chris Lamb Date: Tue, 27 Oct 2009 08:55:06 +0000 Subject: [PATCH] Add doc for session_wrapper. Signed-off-by: Chris Lamb --- daklib/dbconn.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/daklib/dbconn.py b/daklib/dbconn.py index 8ee90768..fb322aea 100755 --- a/daklib/dbconn.py +++ b/daklib/dbconn.py @@ -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') -- 2.39.2