WhisperMaPhone/thoughts/feed.py
Matthias Portzel 1defa2b92c Rename 'main' to 'thoughts'
SQL to migrate the DB. Create migrations, migrate
`DELETE FROM django_content_type WHERE app_label='thoughts';`
`UPDATE django_content_type SET app_label='thoughts' WHERE app_label='main';`
`DROP TABLE thoughts_thought;`
`ALTER TABLE main_thought RENAME TO thoughts_thought;`
`DELETE FROM django_migrations WHERE app='main';`
Hopefully that's right, I'm not going to double check it or anything.
2022-04-30 13:34:39 -04:00

25 lines
509 B
Python

from django.contrib.syndication.views import Feed
from thoughts.models import Thought
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):
return "/?show=" + str(item.uuid)
def item_pubdate(self, item):
return item.posted