MCPcopy Create free account
hub / github.com/diffgram/diffgram / task_list_by_job_api

Function task_list_by_job_api

default/methods/task/task/task_list.py:8–39  ·  view source on GitHub ↗
(job_id)

Source from the content-addressed store, hash-verified

6@routes.route('/api/v1/job/<int:job_id>/task/list', methods = ['POST'])
7@Job_permissions.by_job_id(project_role_list = ["admin", "annotator", "Editor", "Viewer"], apis_user_list = ['builder_or_trainer'])
8def task_list_by_job_api(job_id):
9 with sessionMaker.session_scope() as session:
10 spec_list = [{'date_from': None},
11 {'date_to': None},
12 {'status': None},
13 {'job_id': None},
14 {'all_my_jobs': {'required': False, 'kind': bool}},
15 {'project_string_id': None},
16 {'issues_filter': None},
17 {'project_id': {
18 'required': False,
19 'kind': int
20 }},
21 {'file_id': {
22 'required': False,
23 'kind': int
24 }},
25 {'page_number': {
26 'required': False,
27 'kind': int
28 }},
29 {'incoming_directory_id': None},
30 {'limit_count': {'required': False, 'kind': int, 'default': 10}},
31 {'mode_data': str}]
32
33 log, input, untrusted_input = regular_input.master(request = request,
34 spec_list = spec_list)
35 if len(log["error"].keys()) >= 1:
36 return jsonify(log = log), 400
37 job = Job.get_by_id(session, job_id)
38 member = get_member(session)
39 return _task_list_api(session = session, project_id = job.project.id, input = input, log = log, member = member)
40
41
42@routes.route('/api/v1/project/<string:project_string_id>/task/list', methods = ['POST'])

Callers

nothing calls this directly

Calls 3

get_memberFunction · 0.85
_task_list_apiFunction · 0.85
get_by_idMethod · 0.45

Tested by

no test coverage detected