summaryrefslogtreecommitdiff
path: root/app/posts/views
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf>2021-03-24 14:22:04 -0400
committerluxagraf <sng@luxagraf>2021-03-24 14:22:04 -0400
commit5b86e4c986b39bc1027d371e9c108fa30ef3f052 (patch)
tree22798d834af453abed02f53742acab1785135f63 /app/posts/views
parente807fb3c0e738b512acb68d230e4aae631d3c76d (diff)
lttr: migrated to new post -> lttr -> send system.
Diffstat (limited to 'app/posts/views')
-rw-r--r--app/posts/views/friends_views.py15
-rw-r--r--app/posts/views/range_views.py15
2 files changed, 30 insertions, 0 deletions
diff --git a/app/posts/views/friends_views.py b/app/posts/views/friends_views.py
index dd4dac2..3d6ea8d 100644
--- a/app/posts/views/friends_views.py
+++ b/app/posts/views/friends_views.py
@@ -37,3 +37,18 @@ class FriendsListView(PaginatedListView):
return context
+class FriendsRSSFeedView(Feed):
+ title = "Friends of a Long Year"
+ link = "/range/"
+ description = "Friends of a Long Year: A monthly newsletter"
+ description_template = 'feeds/blog_description.html'
+
+ def items(self):
+ return Post.objects.filter(status__exact=1).filter(post_type=PostType.FRIENDS).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
diff --git a/app/posts/views/range_views.py b/app/posts/views/range_views.py
index 989134d..0a3a564 100644
--- a/app/posts/views/range_views.py
+++ b/app/posts/views/range_views.py
@@ -37,3 +37,18 @@ class RangeListView(PaginatedListView):
return context
+class RangeRSSFeedView(Feed):
+ title = "Range: A weekly photo, developed"
+ link = "/range/"
+ description = "Range: A weekly photo, developed"
+ description_template = 'feeds/blog_description.html'
+
+ def items(self):
+ return Post.objects.filter(status__exact=1).filter(post_type=PostType.RANGE).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