Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

override get_queryset django with url parameters

class SubcategoriesListView(ListView):
    model = Subcategory
    template_name = 'app/categories/index.html'
    def get_queryset(self):
        return Subcategory.objects.filter(category_id=self.kwargs['category_id'])
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #override #django #url #parameters
ADD COMMENT
Topic
Name
6+6 =