MCPcopy Index your code
hub / github.com/diffgram/diffgram / task_list_api

Function task_list_api

default/methods/task/task/task_list.py:44–78  ·  view source on GitHub ↗
(project_string_id)

Source from the content-addressed store, hash-verified

42@routes.route('/api/v1/project/<string:project_string_id>/task/list', methods = ['POST'])
43@Project_permissions.user_has_project(["admin", "annotator", "Editor", "Viewer"])
44def task_list_api(project_string_id):
45 spec_list = [{'date_from': None},
46 {'date_to': None},
47 {'status': None},
48 {'page_number': None},
49 {'job_id': {'required': False, 'kind': int}},
50 {'all_my_jobs': {'required': False, 'kind': bool}},
51 {'issues_filter': None},
52 {'project_string_id': None},
53 {'project_id': {
54 'required': False,
55 'kind': int
56 }},
57 {'file_id': {
58 'required': False,
59 'kind': int
60 }},
61 {'incoming_directory_id': None},
62 {'limit_count': {'required': False, 'kind': int, 'default': 10}},
63 {'mode_data': str}]
64
65 log, input, untrusted_input = regular_input.master(request = request,
66 spec_list = spec_list)
67 with sessionMaker.session_scope() as session:
68 if len(log["error"].keys()) >= 1:
69 return jsonify(log = log), 400
70 # For now we are not supporting querying the entire file list of a project.
71 # So we check we have either a job ID or a FileID to filter with
72 if input['file_id'] is None and input['job_id'] is None and input.get('all_my_jobs') is None:
73 log['error']['file_id'] = 'Please Provide a file ID'
74 log['error']['job_id'] = 'Please Provide a job ID'
75 return jsonify(log = log), 400
76 member = get_member(session)
77 project = Project.get_by_string_id(session, project_string_id = project_string_id)
78 return _task_list_api(session = session, project_id = project.id, input = input, log = log, member = member)
79
80
81def _task_list_api(session, project_id, input = input, member = None, log = regular_log.default()):

Callers

nothing calls this directly

Calls 4

get_memberFunction · 0.85
_task_list_apiFunction · 0.85
getMethod · 0.45
get_by_string_idMethod · 0.45

Tested by

no test coverage detected