def test(): database = db.get_db() database.create_tables([TestModel, Foo]) print [f.get_column_type() for f in Foo._meta.sorted_fields]
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()