Skip to content

Instantly share code, notes, and snippets.

@luhn
Created July 13, 2012 18:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luhn/3106666 to your computer and use it in GitHub Desktop.
Save luhn/3106666 to your computer and use it in GitHub Desktop.
@reify
def db(self):
def cleanup(self):
self.db.close()
self.add_finished_callback(cleanup)
return self.registry.settings['sessionmaker']()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment