Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

class views django slug

class SinglePostByCategory(DetailView):
    def get_queryset(self):
        return get_object_or_404(Post,
            category__slug=self.kwargs['category_slug'],
            slug=self.kwargs['post_slug']
        )
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #class #views #django #slug
ADD COMMENT
Topic
Name
5+4 =