def get_completed_requests(driver_id): now = datetime.datetime.now() now = now.strftime('%Y-%m-%d %H:%M:%S') query = """select * from requests where (driver_id={}) and ("{}" > completed)""".\ format(driver_id, now) result = execute_read_query(query) return result
def get_request_entry(request_id): query = """select * from requests where request_id={}""".format(request_id) result = execute_read_query(query) return result[0]
def get_all_requests(): query = """select * from requests""" result = execute_read_query(query) return result
def get_waiting_requests(): query = """select * from requests where driver_id is NULL""" result = execute_read_query(query) return result