2021-01-20 22:15:15 +00:00
|
|
|
''' '''
|
|
|
|
|
|
|
|
from django.contrib.syndication.views import Feed
|
|
|
|
from django.urls import reverse
|
|
|
|
from bookwyrm.models.user import User
|
|
|
|
from .helpers import get_activity_feed, get_user_from_username
|
|
|
|
|
|
|
|
class RssFeed(Feed):
|
|
|
|
|
|
|
|
description_template = "snippets/rss_content.html"
|
|
|
|
title_template = "snippets/rss_title.html"
|
|
|
|
|
|
|
|
def get_object(self, request, username):
|
|
|
|
return get_user_from_username(username)
|
|
|
|
|
|
|
|
def link(self, obj):
|
|
|
|
return obj.local_path
|
|
|
|
|
|
|
|
def title(self, obj):
|
2021-01-23 23:39:55 +00:00
|
|
|
return f"Status updates from {obj.display_name}"
|
2021-01-20 22:15:15 +00:00
|
|
|
|
|
|
|
|
|
|
|
def items(self, obj):
|
2021-01-28 02:23:20 +00:00
|
|
|
return get_activity_feed(obj, ['public', 'unlisted'], queryset=obj.status_set)
|
2021-01-20 22:15:15 +00:00
|
|
|
|
|
|
|
|
|
|
|
def item_link(self, item):
|
|
|
|
return item.local_path
|
|
|
|
|