summaryrefslogtreecommitdiff
path: root/app/posts/views/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'app/posts/views/__init__.py')
-rw-r--r--app/posts/views/__init__.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/app/posts/views/__init__.py b/app/posts/views/__init__.py
new file mode 100644
index 0000000..5fd984c
--- /dev/null
+++ 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