diff options
Diffstat (limited to 'app/posts/views/__init__.py')
-rw-r--r-- | app/posts/views/__init__.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/app/posts/views/__init__.py b/app/posts/views/__init__.py index e69de29..5fd984c 100644 --- a/app/posts/views/__init__.py +++ b/app/posts/views/__init__.py @@ -0,0 +1,19 @@ +from django.contrib.syndication.views import Feed + +from ..models import Post + +class PostRSSFeedView(Feed): + title = "Luxagraf: Topographical Writings" + link = "https://luxagraf.net/" + description = "Latest postings to luxagraf.net" + description_template = 'feeds/blog_description.html' + + def items(self): + return Post.objects.filter(status__exact=1).order_by('-pub_date')[:10] + + def item_pubdate(self, item): + """ + Takes an item, as returned by items(), and returns the item's + pubdate. + """ + return item.pub_date |