Skip to content

Instantly share code, notes, and snippets.

@sfelde
sfelde / gist:1853908
Created February 17, 2012 14:54 — forked from honzajavorek/gist:1853867
A readable way how to work with Flask-SQLAlchemy
class Transaction(object):
def __init__(self, db):
self.db = db
def __enter__(self):
return self.db.session
def __exit__(self, type, value, traceback):