Files
postgres-web/pgweb/core/feeds.py
Magnus Hagander f31c58ddaa Fix beta versioning to be more generic test versioning
This allows us to specify both beta and rc versions.

Requires SQL:

ALTER TABLE core_version RENAME COLUMN beta TO testing;
ALTER TABLE core_version ALTER COLUMN testing TYPE integer USING CASE WHEN testing THEN 2 ELSE 0 END;
2013-08-22 14:45:33 +02:00

24 lines
640 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 = "http://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 "http://www.postgresql.org/docs/%s/static/%s" % (obj.tree, obj.relnotes)
def item_pubdate(self, obj):
return datetime.combine(obj.reldate,time.min)