Skip to content
Snippets Groups Projects
Commit 5330354b authored by Mario Raciti's avatar Mario Raciti
Browse files

TMSS-692: Add first step to get dataproducts' sizes

parent 034ef28e
No related branches found
No related tags found
1 merge request!410Resolve TMSS-692
......@@ -36,6 +36,9 @@ def _get_subs_and_durations_from_project(project_pk: int) -> {}:
def create_project_report(request: Request, project: models.Project) -> {}:
"""
Create a project report as a JSON object.
"""
# TODO: Retrieve the information needed, all in one go.
project_pk = project.pk
result = {'project': project_pk} # Object to be returned
......@@ -48,4 +51,12 @@ def create_project_report(request: Request, project: models.Project) -> {}:
# Add durations to result
result['durations'] = _get_subs_and_durations_from_project(project_pk)
# Subtask of type 'ingest' within 'finished' status
subtasks = models.Subtask.objects.filter(specifications_template__type='ingest', state='finished')
for subtask in subtasks:
# TODO: Get sum of dataproduct sizes that went to the ingest
output_dataproducts = models.SubtaskOutput.filter(subtask=subtask.pk)
# TODO: For each unique target (SAP name) get the sum of target observation durations from the tasks.
return result
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment