def db(env): dburl = env.database_url maxconn = env.database_maxconn db = GittipDB(dburl, maxconn=maxconn) db.register_model(Community) db.register_model(AccountElsewhere) db.register_model(Participant) db.register_model(EmailAddressWithConfirmation) return db
def db(): dburl = os.environ['DATABASE_URL'] maxconn = int(os.environ['DATABASE_MAXCONN']) db = GittipDB(dburl, maxconn=maxconn) db.register_model(Community) db.register_model(AccountElsewhere) db.register_model(Participant) return db
def db(env): dburl = env.database_url maxconn = env.database_maxconn db = GittipDB(dburl, maxconn=maxconn) db.register_model(Community) db.register_model(AccountElsewhere) db.register_model(Participant) return db
def db(): dburl = os.environ['DATABASE_URL'] maxconn = int(os.environ['DATABASE_MAXCONN']) db = GittipDB(dburl, maxconn=maxconn) # register hstore type with db.get_cursor() as cursor: psycopg2.extras.register_hstore(cursor, globally=True, unicode=True) db.register_model(Community) db.register_model(Participant) return db