def before_request(): """Make sure we are connected to the database each request.""" if DEFAULT_DB == SCIDB: sdbi.scidbOpenConn() else: mdbi.mysqlOpenConn()
def teardown_request(exception): """Closes the database again at the end of the request.""" if DEFAULT_DB == SCIDB: sdbi.scidbCloseConn() else: mdbi.mysqlOpenConn()
def dbclose(): """Closes the database again at the end of the request.""" if DEFAULT_DB == SCIDB: sdbi.scidbCloseConn() else: mdbi.mysqlOpenConn()