Created
October 9, 2020 16:16
-
-
Save mentix02/5d4031d103509996a4ed200c0d46742f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PostDetailView(DetailView): | |
model = Post | |
slug_field = 'slug' | |
slug_url_kwarg = 'post' | |
context_object_name = 'post' | |
template_name = 'blog/post/detail.html' | |
def get_queryset(self): | |
return self.model.objects.filter( | |
publish__day=self.kwargs['day'], | |
publish__year=self.kwargs['year'], | |
publish__month=self.kwargs['month'], | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment