📜  类视图 django slug - Python 代码示例

📅  最后修改于: 2022-03-11 14:47:22.753000             🧑  作者: Mango

代码示例1
class SinglePostByCategory(DetailView):
    def get_queryset(self):
        return get_object_or_404(Post,
            category__slug=self.kwargs['category_slug'],
            slug=self.kwargs['post_slug']
        )