Last active
August 29, 2015 14:01
-
-
Save derks/1a359db6514308d16644 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from cement.core import hook | |
def add_db_object(app): | |
# setup your database object here, note you can | |
# get database config settings from app.config.get() | |
my_db_object = WhateverYourDatabaseIs() | |
app.extend('db', my_db_object) | |
hook.register('pre_run', add_db_object) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment