Skip to content

Instantly share code, notes, and snippets.

Created December 28, 2015 20:06
Show Gist options
  • Select an option

  • Save anonymous/592cd8920228f8f43dbf to your computer and use it in GitHub Desktop.

Select an option

Save anonymous/592cd8920228f8f43dbf to your computer and use it in GitHub Desktop.
class CategoryList(ListView):
template_name = 'app/categories.html'
model = Category
def get_queryset(self):
self.category = get_object_or_404(Category, slug=self.args[0])
return Category.objects.filter(category=self.category)
class CategoryList(ListView):
template_name = 'app/categories.html'
model = Category
def get_queryset(self):
self.category = get_object_or_404(Category, slug=self.args[0])
return Category.objects.filter(category=self.category), Item.objects.filter(category=self.category)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment