Exemple #1
0
def test():
    database = db.get_db()
    database.create_tables([TestModel, Foo])

    print [f.get_column_type() for f in Foo._meta.sorted_fields]
Exemple #2
0
def db_route_exit_hook(req):
    ''' Auto close connection at the end of request '''
    database = db.get_db(False)

    if not database.is_closed():
        database.close()