Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added latest-comments RSS feed to djangoproject.com

git-svn-id: http://code.djangoproject.com/svn/djangoproject.com@368 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 5102c294c1306d016abea94456aa2db2c86ddae9 1 parent c8fb79a
adrian authored
13 django_website/settings/main_rss.py
View
@@ -1,5 +1,6 @@
from django.core import rss
from django.models.blog import entries
+from django.models.comments import freecomments
weblog_entry_feed = rss.FeedConfiguration(
slug = 'weblog',
@@ -12,4 +13,16 @@
}
)
+recent_comments = rss.FeedConfiguration(
+ slug = 'comments',
+ title_cb = lambda param: "Recent comments on djangoproject.com",
+ link_cb = lambda param: "http://www.djangoproject.com/comments/",
+ description_cb = lambda param: "Recent comments posted to djangoproject.com.",
+ get_list_func_cb = lambda obj: freecomments.get_list,
+ get_list_kwargs = {
+ 'limit': 15,
+ }
+)
+
+rss.register_feed(recent_comments)
rss.register_feed(weblog_entry_feed)
3  django_website/templates/rss/comments_description.html
View
@@ -0,0 +1,3 @@
+<p>Posted by {{ obj.person_name }} on {{ obj.submit_date|date:"F j, Y" }} at {{ obj.submit_date|date:"P" }}</p>
+<p>Page: {{ obj.get_content_object }}</p>
+{{ obj.comment|linebreaks }}
1  django_website/templates/rss/comments_title.html
View
@@ -0,0 +1 @@
+<p>Comment by {{ obj.person_name }} on {{ obj.submit_date|date:"F j, Y" }}</p>
Please sign in to comment.
Something went wrong with that request. Please try again.