Esempio n. 1
0
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
Esempio n. 2
0
def get_request_entry(request_id):
    query = """select * from requests where request_id={}""".format(request_id)
    result = execute_read_query(query)
    return result[0]
Esempio n. 3
0
def get_all_requests():
    query = """select * from requests"""
    result = execute_read_query(query)
    return result
Esempio n. 4
0
def get_waiting_requests():
    query = """select * from requests where driver_id is NULL"""
    result = execute_read_query(query)
    return result