Files
postgres-web/pgweb/events/feeds.py
Jonathan S. Katz 2f52c4f7c4 Clean up whitespace in primary Python / HTML files
Clean up the whitespace in the primary Python / HTML files in
order to make it easier to apply changes going forward.
2017-11-29 08:21:35 -05:00

22 lines
579 B
Python

from django.contrib.syndication.views import Feed
from models import Event
from datetime import datetime, time
class EventFeed(Feed):
title = description = "PostgreSQL events"
link = "https://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 "https://www.postgresql.org/about/event/%s/" % obj.id
def item_pubdate(self, obj):
return datetime.combine(obj.startdate,time.min)