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