SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit cffb5725 authored by Jean-Sébastien Caux's avatar Jean-Sébastien Caux
Browse files

Move to Atom1 feed instead of RSS2

parent f817fa67
No related branches found
No related tags found
No related merge requests found
from django.contrib.syndication.views import Feed from django.contrib.syndication.views import Feed
from django.utils.feedgenerator import Atom1Feed
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from comments.models import Comment from comments.models import Comment
class LatestCommentFeed(Feed): class LatestCommentFeed(Feed):
title = "SciPost Latest Comments" title = "SciPost Latest Comments"
subtitle = "SciPost Latest Comments"
link = "/" link = "/"
feed_type = Atom1Feed
def items(self): def items(self):
return Comment.objects.filter(status__gte=0).order_by('-date_submitted')[:5] return Comment.objects.filter(status__gte=0).order_by('-date_submitted')[:5]
...@@ -13,8 +16,8 @@ class LatestCommentFeed(Feed): ...@@ -13,8 +16,8 @@ class LatestCommentFeed(Feed):
def item_title(self, item): def item_title(self, item):
return item.comment_text[:50] return item.comment_text[:50]
# def item_description(self, item): def item_subtitle(self, item):
# return item.description return item.subtitle
def item_link(self, item): def item_link(self, item):
if item.commentary: if item.commentary:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment