[Answered ]-Django ListView __init__ accepting keyword arguments

2👍

Because they are class-based, you have access to the keyword arguements anywhere in the class via self:

def get_queryset(self):
    # filter for data based on category_slug input
    categories = self.model.objects.filter(slug=self.kwargs['category_slug'])
    ...
    return categories

Leave a comment