WhisperMaPhone/thoughts/feed.py

25 lines
509 B
Python
Raw Normal View History

2020-09-12 17:04:34 +00:00
from django.contrib.syndication.views import Feed
from thoughts.models import Thought
2020-09-12 17:04:34 +00:00
class MainFeed(Feed):
title = "Thoughts"
link = "/"
@staticmethod
def items():
return Thought.objects.all().order_by("-posted")
def item_title(self, item):
return item.text
def item_description(self, item):
return item.extended_text
def item_link(self, item):
2020-11-24 18:42:09 +00:00
return "/?show=" + str(item.uuid)
2020-09-12 17:04:34 +00:00
def item_pubdate(self, item):
return item.posted