[Fixed]-Building cascade structure

1👍

This site is invaluable to work your way around Class Based Views (ListView)

I think you need to override the get method, something like this:

class SubjectsView(generic.ListView):
    ... 
    def get(self, request, *args, slug_category=None, **kwargs):
        if slug_category:
            self.queryset = Subject.objects.filter(category__slug_category=slug_category)
        super(SubjectsView, self).get(request, *args, slug_category=slug_category, **kwargs)
👤Dan

0👍

queryset = Subject.objects.get(category=parametrocategoria)
queryset = Post.objects.get(subject=parametrosubjet)

You simply choose to perform query

Leave a comment