Files
postgres-web/pgweb/pwn/feeds.py
2013-06-16 16:35:20 +02:00

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)