Groups profile settings templates

This commit is contained in:
Mouse Reeve
2021-01-29 09:28:00 -08:00
parent 24af288c52
commit 9fa8ee3940
12 changed files with 41 additions and 32 deletions

View File

@ -1,29 +1,35 @@
''' '''
''' serialize user's posts in rss feed '''
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
# pylint: disable=no-self-use, unused-argument
class RssFeed(Feed):
description_template = "snippets/rss_content.html"
title_template = "snippets/rss_title.html"
''' serialize user's posts in rss feed '''
description_template = 'snippets/rss_content.html'
title_template = 'snippets/rss_title.html'
def get_object(self, request, username):
''' the user who's posts get serialized '''
return get_user_from_username(username)
def link(self, obj):
''' link to the user's profile '''
return obj.local_path
def title(self, obj):
return f"Status updates from {obj.display_name}"
''' title of the rss feed entry '''
return f'Status updates from {obj.display_name}'
def items(self, obj):
return get_activity_feed(obj, ['public', 'unlisted'], queryset=obj.status_set)
''' the user's activity feed '''
return get_activity_feed(
obj, ['public', 'unlisted'], queryset=obj.status_set)
def item_link(self, item):
''' link to the status '''
return item.local_path