deseasion.backend.services.project_data module

class deseasion.backend.services.project_data.ProjectDataService

Bases: object

get_grouped_dependant_data_ids(data)

Return the ids of project data that need to be processed, sorted and grouped by depth.

The grouped project data are independant and can be processed in parallel.

get_if_authorized(project_data_id) ProjectData

Load the the project data if the user is authorized to access it.

Raises:

PermissionError if the user is not authorized to access the data’s project. RequestError (code 404) if the project data does not exist.

Returns:

The project data object.

get_used_attributes(data_id) list[DataAttribute]

Get used attributes of project data if the user is authorized to access it.

This list contains all attributes used at least once in a processing model of the downstream project data.

Raises:

PermissionError if the user is not authorized to access the data’s project. RequestError (code 404) if the project data does not exist.

Returns:

Used attributes.

get_used_input_attributes(data_id) list[DataAttribute]

Get used input attributes of project data if the user is authorized to access it.

This list contains al inputl attributes used at least once in a processing model of the project data.

Raises:

PermissionError if the user is not authorized to access the data’s project. RequestError (code 404) if the project data does not exist.

Returns:

Used input attributes.