Beispiel #1
0
 def post(self, task_type_id):
     permissions.check_manager_permissions()
     criterions = query.get_query_criterions_from_request(request)
     shots = shots_service.get_shots(criterions)
     task_type = tasks_service.get_task_type(task_type_id)
     tasks = [tasks_service.create_task(task_type, shot) for shot in shots]
     return tasks, 201
Beispiel #2
0
 def get(self):
     """
     Retrieve all entity types that are not shot or sequence.
     """
     criterions = query.get_query_criterions_from_request(request)
     asset_types = asset_info.get_asset_types(criterions)
     return EntityType.serialize_list(asset_types)
Beispiel #3
0
 def get(self):
     """
     Retrieve all shot entries. Filters can be specified in the query string.
     """
     criterions = query.get_query_criterions_from_request(request)
     shots = shot_info.get_shots(criterions)
     return Entity.serialize_list(shots)
Beispiel #4
0
 def get(self, project_id, asset_type_id):
     """
     Retrieve all assets for given project and entity type.
     ---
     tags:
         - Assets
     parameters:
       - in: path
         name: project_id
         required: True
         schema:
             type: UUID
             example: a24a6ea4-ce75-4665-a070-57453082c25
       - in: path
         name: asset_type_id
         required: True
         schema:
             type: UUID
             example: a24a6ea4-ce75-4665-a070-57453082c25        
     responses:
         200:
             description: All assets for given project and entity type    
     """
     user_service.check_project_access(project_id)
     criterions = query.get_query_criterions_from_request(request)
     criterions["project_id"] = project_id
     criterions["entity_type_id"] = asset_type_id
     if permissions.has_vendor_permissions():
         criterions["assigned_to"] = persons_service.get_current_user(
         )["id"]
     return assets_service.get_assets(criterions)
Beispiel #5
0
 def get(self):
     """
     Retrieve all asset types (entity types that are not shot, sequence or
     episode).
     """
     criterions = query.get_query_criterions_from_request(request)
     return assets_service.get_asset_types(criterions)
Beispiel #6
0
 def get(self):
     """
     Retrieve all shot entries. Filters can be specified in the query string.
     """
     criterions = query.get_query_criterions_from_request(request)
     if not permissions.has_manager_permissions():
         user_service.check_criterions_has_task_related(criterions)
     return shots_service.get_shots(criterions)
Beispiel #7
0
 def get(self):
     """
     Retrieve all shots, adds project name and asset type name and all
     related tasks.
     """
     criterions = query.get_query_criterions_from_request(request)
     user_service.check_project_access(criterions.get("project_id", None))
     return shots_service.get_shots_and_tasks(criterions)
Beispiel #8
0
 def get(self):
     """
     Retrieve all scene entries. Filters can be specified in the query
     string.
     """
     criterions = query.get_query_criterions_from_request(request)
     user_service.check_project_access(criterions)
     return shots_service.get_scenes(criterions)
Beispiel #9
0
 def test_get_query_criterions(self):
     request = type('test', (object, ), {})()
     request.args = {"page": "1", "name": "Test", "project_id": "1234"}
     criterions = query.get_query_criterions_from_request(request)
     self.assertDictEqual(criterions, {
         "name": "Test",
         "project_id": "1234"
     })
Beispiel #10
0
 def get(self, project_id):
     """
     Retrieve all assets for given project.
     """
     user_service.check_project_access(project_id)
     criterions = query.get_query_criterions_from_request(request)
     criterions["project_id"] = project_id
     return assets_service.get_assets(criterions)
Beispiel #11
0
 def get(self, project_id):
     """
     Retrieve all assets for given project.
     """
     criterions = query.get_query_criterions_from_request(request)
     criterions["project_id"] = project_id
     assets = asset_info.get_assets(criterions)
     return Entity.serialize_list(assets)
Beispiel #12
0
 def get(self):
     """
     Retrieve all entities that are not shot or sequence.
     Adds project name and asset type name.
     """
     criterions = query.get_query_criterions_from_request(request)
     user_service.check_project_access(criterions.get("project_id", None))
     return assets_service.get_assets(criterions)
Beispiel #13
0
 def get(self):
     """
     Retrieve all episode, adds project name and asset type name and all
     related tasks.
     """
     criterions = query.get_query_criterions_from_request(request)
     user_service.check_project_access(criterions.get("project_id", None))
     criterions["entity_type_id"] = shots_service.get_episode_type()["id"]
     return entities_service.get_entities_and_tasks(criterions)
Beispiel #14
0
 def get(self):
     """
     Retrieve all entities that are not shot or sequence.
     Adds project name and asset type name.
     """
     criterions = query.get_query_criterions_from_request(request)
     if not permissions.has_manager_permissions():
         user_service.check_criterions_has_task_related(criterions)
     return assets_service.all_assets(criterions)
Beispiel #15
0
 def get(self):
     """
     Retrieve all shots, adds project name and asset type name and all
     related tasks.
     """
     criterions = query.get_query_criterions_from_request(request)
     if not permissions.has_manager_permissions():
         user_service.check_criterions_has_task_related(criterions)
     return shots_service.get_shots_and_tasks(criterions)
Beispiel #16
0
 def get(self, instance_id):
     """
     Retrieve all sequence entries for a given episode.
     Filters can be specified in the query string.
     """
     criterions = query.get_query_criterions_from_request(request)
     criterions["parent_id"] = instance_id
     sequences = shot_info.get_sequences(criterions)
     return Entity.serialize_list(sequences)
Beispiel #17
0
 def get(self):
     """
     Retrieve all edit entries. Filters can be specified in the query string.
     """
     criterions = query.get_query_criterions_from_request(request)
     if permissions.has_vendor_permissions():
         criterions["assigned_to"] = persons_service.get_current_user(
         )["id"]
     user_service.check_project_access(criterions.get("project_id", None))
     return edits_service.get_edits(criterions)
Beispiel #18
0
 def get(self, project_id):
     """
     Retrieve all assets for given project.
     """
     if not permissions.has_manager_permissions():
         user_service.check_has_task_related(project_id)
     criterions = query.get_query_criterions_from_request(request)
     criterions["project_id"] = project_id
     assets = assets_service.get_assets(criterions)
     return assets
Beispiel #19
0
    def post(self, task_type_id):
        criterions = query.get_query_criterions_from_request(request)
        if "project_id" not in criterions:
            return {"error": True, "message": "Project ID is missing"}, 400

        user_service.check_manager_project_access(criterions["project_id"])
        shots = shots_service.get_shots(criterions)
        task_type = tasks_service.get_task_type(task_type_id)
        tasks = [tasks_service.create_task(task_type, shot) for shot in shots]
        return tasks, 201
Beispiel #20
0
 def get(self):
     """
     Retrieve all shots, adds project name and asset type name and all
     related tasks.
     """
     criterions = query.get_query_criterions_from_request(request)
     user_service.check_project_access(criterions.get("project_id", None))
     if permissions.has_vendor_permissions():
         criterions["assigned_to"] = persons_service.get_current_user()["id"]
     return shots_service.get_shots_and_tasks(criterions)
Beispiel #21
0
 def get(self):
     """
     Retrieve all shot entries. Filters can be specified in the query string.
     """
     criterions = query.get_query_criterions_from_request(request)
     if "sequence_id" in criterions:
         sequence = shots_service.get_sequence(criterions["sequence_id"])
         criterions["project_id"] = sequence["project_id"]
     user_service.check_project_access(criterions)
     return shots_service.get_shots(criterions)
Beispiel #22
0
 def get(self, sequence_id):
     """
     Retrieve all shot entries for a given sequence.
     Filters can be specified in the query string.
     """
     sequence = shots_service.get_sequence(sequence_id)
     user_service.check_project_access(sequence["project_id"])
     criterions = query.get_query_criterions_from_request(request)
     criterions["parent_id"] = sequence_id
     return shots_service.get_shots(criterions)
Beispiel #23
0
 def get(self):
     """
     Retrieve all entities that are not shot or sequence.
     Adds project name and asset type name.
     """
     criterions = query.get_query_criterions_from_request(request)
     user_service.check_project_access(criterions.get("project_id", None))
     if permissions.has_vendor_permissions():
         criterions["assigned_to"] = persons_service.get_current_user(
         )["id"]
     return assets_service.get_assets(criterions)
Beispiel #24
0
 def get(self, project_id):
     """
     Retrieve all assets for given project.
     """
     user_service.check_project_access(project_id)
     criterions = query.get_query_criterions_from_request(request)
     criterions["project_id"] = project_id
     if permissions.has_vendor_permissions():
         criterions["assigned_to"] = persons_service.get_current_user(
         )["id"]
     return assets_service.get_assets(criterions)
Beispiel #25
0
 def get(self):
     """
     Retrieve all entities that are not shot or sequence.
     Adds project name and asset type name and all related tasks.
     If episode_id is given as parameter, it returns assets not linked
     to an episode and assets linked to given episode.
     """
     criterions = query.get_query_criterions_from_request(request)
     page = query.get_page_from_request(request)
     user_service.check_project_access(criterions.get("project_id", None))
     return assets_service.get_assets_and_tasks(criterions, page)
Beispiel #26
0
 def get(self, sequence_id):
     """
     Retrieve all shot entries for a given sequence.
     Filters can be specified in the query string.
     """
     sequence = shots_service.get_sequence(sequence_id)
     if not permissions.has_manager_permissions():
         user_service.check_has_task_related(sequence["project_id"])
     criterions = query.get_query_criterions_from_request(request)
     criterions["parent_id"] = sequence_id
     return shots_service.get_shots(criterions)
Beispiel #27
0
 def get(self):
     """
     Retrieve all asset types (entity types that are not shot, sequence or episode).
     ---
     tags:
       - Assets
     responses:
       200:
         description: All asset types
     """
     criterions = query.get_query_criterions_from_request(request)
     return assets_service.get_asset_types(criterions)
Beispiel #28
0
 def get(self, sequence_id):
     """
     Retrieve all shot entries for a given sequence.
     Filters can be specified in the query string.
     """
     sequence = shots_service.get_sequence(sequence_id)
     user_service.check_project_access(sequence["project_id"])
     criterions = query.get_query_criterions_from_request(request)
     criterions["parent_id"] = sequence_id
     if permissions.has_vendor_permissions():
         criterions["assigned_to"] = persons_service.get_current_user()["id"]
     return shots_service.get_shots(criterions)
Beispiel #29
0
 def get(self):
     """
     Retrieve all sequence entries. Filters can be specified in the query
     string.
     """
     criterions = query.get_query_criterions_from_request(request)
     if "episode_id" in criterions:
         episode = shots_service.get_episode(criterions["episode_id"])
         criterions["project_id"] = episode["project_id"]
         criterions["parent_id"] = episode["id"]
         del criterions["episode_id"]
     user_service.check_project_access(criterions.get("project_id", None))
     return shots_service.get_sequences(criterions)
Beispiel #30
0
 def get(self):
     """
     Retrieve all shot entries. Filters can be specified in the query string.
     """
     criterions = query.get_query_criterions_from_request(request)
     if "sequence_id" in criterions:
         sequence = shots_service.get_sequence(criterions["sequence_id"])
         criterions["project_id"] = sequence["project_id"]
         criterions["parent_id"] = sequence["id"]
         del criterions["sequence_id"]
     if permissions.has_vendor_permissions():
         criterions["assigned_to"] = persons_service.get_current_user()["id"]
     user_service.check_project_access(criterions.get("project_id", None))
     return shots_service.get_shots(criterions)