Example #1
0
def teardown_request(exception):
    DatabaseConnector.release(g.conn)
Example #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)
Example #3
0
def before_first_request():
    DatabaseConnector.initialize(dbm.config['dbms']['host'],
                                 dbm.config['dbms']['user'],
                                 dbm.config['dbms']['passwd'],
                                 dbm.config['courses'], 10)
Example #4
0
def teardown_request(exception):
    DatabaseConnector.release(g.conn)
Example #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)
Example #6
0
def before_first_request():
    DatabaseConnector.initialize(dbm.config['dbms']['host'],
                                 dbm.config['dbms']['user'],
                                 dbm.config['dbms']['passwd'],
                                 dbm.config['courses'], 10)