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