3 from django.contrib.auth.models import User
4 from django.views.generic.detail import DetailView
5 from django.views.generic.list import ListView
9 class PostDetailView(DetailView):
12 class PostListView(ListView):
16 def get_queryset(self):
17 now = datetime.datetime.utcnow()
19 return super().get_queryset().filter(
20 publication_utc__lte=now,
21 ).order_by('-publication_utc')