mirror of
https://github.com/postgres/pgweb.git
synced 2025-08-09 03:54:08 +00:00
23 lines
573 B
Python
23 lines
573 B
Python
from django.contrib.syndication.views import Feed
|
|
|
|
from models import PwnPost
|
|
|
|
from datetime import datetime, time
|
|
|
|
class PwnFeed(Feed):
|
|
title = description = "PostgreSQL Weekly News"
|
|
link = "http://www.postgresql.org/community/weeklynews/"
|
|
|
|
description_template = 'pwn/rss_description.html'
|
|
title_template = 'pwn/rss_title.html'
|
|
|
|
def items(self):
|
|
return PwnPost.objects.all()[:5]
|
|
|
|
def item_link(self, obj):
|
|
return "http://www.postgresql.org/community/weeklynews/pwn%s/" % obj.linkdate
|
|
|
|
def item_pubdate(self, obj):
|
|
return datetime.combine(obj.date,time.min)
|
|
|