def filter_queryset(self, queryset): project = generics.get_object_or_404(Project.objects.for_user( self.request.user), pk=self.kwargs.get('pk', 0)) tasks = Task.objects.filter(project=project) page = paginator(tasks, self.request) if page: return page else: raise Http404
def get_queryset(self): project = get_object_with_permissions(self.request, Project, self.kwargs.get('pk', 0), 'projects.view_project') tasks = Task.objects.filter(project=project) return paginator(tasks, self.request)
def get_queryset(self): project = generics.get_object_or_404(Project.objects.for_user( self.request.user), pk=self.kwargs.get('pk', 0)) tasks = Task.objects.filter(project=project) return paginator(tasks, self.request)