summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSayan Chowdhury <sayan.chowdhury2012@gmail.com>2011-09-28 12:12:57 +0530
committerSayan Chowdhury <sayan.chowdhury2012@gmail.com>2011-09-28 12:12:57 +0530
commita822dec80256a53ba9770be2c9e5cf8ce48bfca1 (patch)
tree18f4959f10966b310be5edfd256782d3dedff4ef
parentf67ed6b73eb18750acb921d08f414b5d6af78ef6 (diff)
downloadaskbot-a822dec80256a53ba9770be2c9e5cf8ce48bfca1.tar.gz
askbot-a822dec80256a53ba9770be2c9e5cf8ce48bfca1.tar.bz2
askbot-a822dec80256a53ba9770be2c9e5cf8ce48bfca1.zip
added item description in rss feed and changed the format in rss feed of particular question
-rw-r--r--askbot/feed.py23
1 files changed, 20 insertions, 3 deletions
diff --git a/askbot/feed.py b/askbot/feed.py
index 61fd0d3a..c4257ab9 100644
--- a/askbot/feed.py
+++ b/askbot/feed.py
@@ -53,14 +53,26 @@ class RssParticularQuestionFeed(Feed):
return results
def item_title(self, item):
+ """returns the title for the item
+ """
title = item
if item.__class__.__name__ == "Question":
self.title = item
- if item.__class__.__name__ == "Answer":
- title = "Answer for %s " %self.title
+ elif item.__class__.__name__ == "Answer":
+ title = "Answer by %s for %s " %(item.author,self.title)
elif item.__class__.__name__ == "Comment":
- title = "Comment for %s" %self.title
+ title = "Comment by %s for %s" %(item.user,self.title)
return title
+
+ def item_description(self,item):
+ """returns the description for the item
+ """
+ if item.__class__.__name__ == "Question":
+ return item.text
+ if item.__class__.__name__ == "Answer":
+ return item.text
+ elif item.__class__.__name__ == "Comment":
+ return item.comment
class RssLastestQuestionsFeed(Feed):
"""rss feed class for the latest questions
@@ -96,6 +108,11 @@ class RssLastestQuestionsFeed(Feed):
because the slug can change
"""
return self.link + item.get_absolute_url(no_slug = True)
+
+ def item_description(self, item):
+ """returns the desciption for the item
+ """
+ return item.text
def items(self, item):
"""get questions for the feed