*Code wurde PEP-8 gerecht formatiert * Kleine Fehler die der PyCharm Inspector beanstandet wurden korrigiert
25 lines
673 B
Python
25 lines
673 B
Python
import django.contrib.syndication.views
|
|
from .models import FeedItem
|
|
|
|
|
|
# noinspection PyMethodMayBeStatic
|
|
class LatestFeedItems(django.contrib.syndication.views.Feed):
|
|
link = "http://aol.animanga.at/"
|
|
description = "Aktuelle Nachrichten aus der Austrian Otaku League"
|
|
title = "AOL - Newsfeed"
|
|
|
|
def items(self):
|
|
return FeedItem.objects.get_recent_items()
|
|
|
|
def item_title(self, item):
|
|
return "%s: %s" % (item.feed.title, item.title)
|
|
|
|
def item_description(self, item):
|
|
return item.summary
|
|
|
|
def item_author_name(self, item):
|
|
return item.feed.title
|
|
|
|
def item_pubdate(self, item):
|
|
return item.date_modified
|