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)
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
def read(self, request): project_name = Project.getNameFromRequest(request) project = get_object_or_404(Project, name=project_name) shot_name = Shot.getNameFromRequest(request) shot = get_object_or_404(Shot, project=project, name=shot_name) filtered_set = self.queryset._clone() filtered_set = filtered_set.filter(shot=shot) return self.responder.list(request, filtered_set)