mirror of
https://github.com/postgres/pgweb.git
synced 2025-08-13 13:12:42 +00:00

Contains basic functionality, and an import of most of the static content from the old site. There is still plenty more to do...
23 lines
578 B
Python
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)
|
|
|