Esempio n. 1
0
    def read(self, request):
        project_name = Project.getNameFromRequest(request)
        project = Project.getProject(project_name)

        filtered_set = self.queryset._clone()
        filtered_set = filtered_set.filter(project=project)
        return self.responder.list(request, filtered_set)
Esempio n. 2
0
    def _pre_init(self, request, new_model, data):
        """
        Associates a resource with shot and project specified in URI
        """
        # TODO: specifiy form_class in urls.py to verify data
        project_name = Project.getNameFromRequest(request)
        project = Project.getProject(project_name, create=True)

        shot_name = Shot.getNameFromRequest(request)
        shot = Shot.getShot(shot_name, project, create=True)

        # associate with the shot
        new_model.shot = shot