예제 #1
0
def query_list_id_by_name(list_name):
    url = api_urls.query_list_id_by_name(list_name)
    res = RestRequestGet(url).execute()

    try:
        return res[0]["id"]
    except IndexError:
        raise ListNotFound(list_name)
예제 #2
0
def query_lists():
    lists = RestRequestGet(api_urls.all_lists()).execute()
    return lists
예제 #3
0
def query_task(list_name: str, task_name: str):
    query_url = api_urls.query_task_by_name(get_list_id_by_name(list_name), task_name)
    return RestRequestGet(query_url).execute()
예제 #4
0
def query_tasks(list_name: str, num_tasks: int = 100):
    query_url = api_urls.query_completed_tasks(
        get_list_id_by_name(list_name), num_tasks
    )
    return RestRequestGet(query_url).execute()
예제 #5
0
파일: todo_api.py 프로젝트: kiblee/tod0
def query_lists():
    result = RestRequestGet(api_urls.all_lists()).execute()
    return [TodoList(x) for x in result]
예제 #6
0
파일: todo_api.py 프로젝트: kiblee/tod0
def query_task(list_name: str, task_name: str):
    query_url = api_urls.query_task_by_name(get_list_id_by_name(list_name),
                                            task_name)
    result = RestRequestGet(query_url).execute()
    return [Task(x) for x in result]