3 from django.contrib.auth.models import User
4 from django.contrib.syndication.views import Feed
5 from django.utils.feedgenerator import Atom1Feed
6 from django.views.generic.detail import DetailView
7 from django.views.generic.list import ListView
16 subtitle = 'styx blog'
19 now = datetime.datetime.utcnow()
21 return models.Post.objects.filter(
22 publication_utc__lte=now,
23 ).order_by('-publication_utc')
25 class PostDetailView(DetailView):
28 class PostListView(ListView):
32 def get_queryset(self):
33 now = datetime.datetime.utcnow()
35 return super().get_queryset().filter(
36 publication_utc__lte=now,
37 ).order_by('-publication_utc')