Files
postgres-web/pgweb/core/feeds.py
Jonathan S. Katz c95fb76a05 Remove references to the (static|interactive) path to documentation.
While the permanent redirect will fix this over the course of time,
it is still better that we do not reference the old path from pgweb.
2018-11-05 10:23:41 -05:00

23 lines
637 B
Python

from django.contrib.syndication.views import Feed
from models import Version
from datetime import datetime, time
class VersionFeed(Feed):
title = "PostgreSQL latest versions"
link = "https://www.postgresql.org/"
description = "PostgreSQL latest versions"
description_template = 'core/version_rss_description.html'
title_template = 'core/version_rss_title.html'
def items(self):
return Version.objects.filter(tree__gt=0).filter(testing=0)
def item_link(self, obj):
return "https://www.postgresql.org/docs/%s/%s" % (obj.numtree, obj.relnotes)
def item_pubdate(self, obj):
return datetime.combine(obj.reldate,time.min)