]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/feed.py
errror => error
[osqa.git] / forum / feed.py
index 60c2d3fe0ab3bf32a26d663e1039580f4dba7c0c..810a7422f9dac3c92f07e011ec36783ced0ce601 100644 (file)
@@ -63,7 +63,7 @@ class BaseNodeFeed(Feed):
     if old_version:
         def __call__(self, request):
             feedgen = self.get_feed('')
-            response = HttpResponse(mimetype=feedgen.mime_type)
+            response = HttpResponse(content_type=feedgen.mime_type)
             feedgen.write(response, 'utf-8')
             return response
 
@@ -78,8 +78,11 @@ class RssQuestionFeed(BaseNodeFeed):
     def item_categories(self, item):
         return item.tagname_list()  
 
+    def _items(self):
+       return self._question_list
+
     def items(self):
-       return self._question_list[:30]
+        return self._items()[:30]
 
 class RssAnswerFeed(BaseNodeFeed):
     if old_version:
@@ -94,13 +97,16 @@ class RssAnswerFeed(BaseNodeFeed):
         self._question = question
         self._include_comments = include_comments
 
-    def items(self):
+    def _items(self):
         if self._include_comments:
             qs = self._question.all_children
         else:
             qs = self._question.answers
 
-        return qs.filter_state(deleted=False).order_by('-added_at')[:30]
+        return qs.filter_state(deleted=False).order_by('-added_at')
+
+    def items(self):
+        return self._items()[:30]
 
     def item_title(self, item):
         if item.node_type == "answer":