mirror of
https://git.sdbs.cz/sdbs/pile.git
synced 2025-05-10 00:12:18 +00:00
add item pubdate to rss feed
This commit is contained in:
parent
b79cd1c531
commit
b85520f7b8
1 changed files with 6 additions and 2 deletions
|
@ -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()
|
||||||
|
|
Loading…
Add table
Reference in a new issue