mirror of
https://github.com/postgres/pgweb.git
synced 2025-08-03 15:38:59 +00:00

Clean up the whitespace in the primary Python / HTML files in order to make it easier to apply changes going forward.
22 lines
579 B
Python
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)
|