示例#1
0
def teardown_request(exception):
    DatabaseConnector.release(g.conn)
示例#2
0
def set_coursecode(endpoint, values):
    g.coursecode = values.pop('coursecode')
    if g.coursecode not in dbm.config['courses']:
        raise Exception('Invalid Course')
    g.conn = DatabaseConnector.get_connection(g.coursecode)
示例#3
0
def before_first_request():
    DatabaseConnector.initialize(dbm.config['dbms']['host'],
                                 dbm.config['dbms']['user'],
                                 dbm.config['dbms']['passwd'],
                                 dbm.config['courses'], 10)
示例#4
0
def teardown_request(exception):
    DatabaseConnector.release(g.conn)
示例#5
0
def set_coursecode(endpoint, values):
    g.coursecode = values.pop('coursecode')
    if g.coursecode not in dbm.config['courses']:
        raise Exception('Invalid Course')
    g.conn = DatabaseConnector.get_connection(g.coursecode)
示例#6
0
def before_first_request():
    DatabaseConnector.initialize(dbm.config['dbms']['host'],
                                 dbm.config['dbms']['user'],
                                 dbm.config['dbms']['passwd'],
                                 dbm.config['courses'], 10)