Files
postgres-web/pgweb/events/feeds.py
Magnus Hagander 90b758c247 A first very basic import.
Contains basic functionality, and an import of most of the static content
from the old site.

There is still plenty more to do...
2009-09-14 14:39:25 +02:00

23 lines
578 B
Python

from django.contrib.syndication.feeds import Feed
from models import Event
from datetime import datetime, time
class EventFeed(Feed):
title = description = "PostgreSQL events"
link = "http://www.postgresql.org/"
description_template = 'events/rss_description.html'
title_template = 'events/rss_title.html'
def items(self):
return Event.objects.filter(approved=True).filter(training=False)[:10]
def item_link(self, obj):
return "http://www.postgresql.org/about/event/%s/" % obj.id
def item_pubdate(self, obj):
return datetime.combine(obj.startdate,time.min)