add item pubdate to rss feed

This commit is contained in:
Tomáš Mládek 2020-04-07 18:23:47 +02:00
parent b79cd1c531
commit b85520f7b8

View file

@ -1,6 +1,7 @@
# Create your views here.
import io
import logging
from datetime import datetime
from operator import itemgetter
from random import choice
@ -162,8 +163,11 @@ class RecentlyUploadedFeed(Feed):
def items(self):
return Document.exclude_hidden.order_by('-uploaded')[:5]
def item_title(self, item):
def item_title(self, item: Document):
return item.title
def item_description(self, item):
def item_description(self, item: Document):
return item.description
def item_pubdate(self, item: Document):
return item.uploaded or datetime.now()