Ticket #5766: comments-cleanup-r6522.diff
File comments-cleanup-r6522.diff, 1005 bytes (added by , 17 years ago) |
---|
-
django/contrib/comments/feeds.py
4 4 from django.contrib.sites.models import Site 5 5 6 6 class LatestFreeCommentsFeed(Feed): 7 " Feed of latest comments on the current site."7 """Feed of latest free comments on the current site.""" 8 8 9 9 comments_class = FreeComment 10 comment_count_limit = 40 10 11 11 12 def title(self): 12 13 if not hasattr(self, '_site'): … … 27 28 return self.comments_class.objects.filter(site__pk=settings.SITE_ID, is_public=True) 28 29 29 30 def items(self): 30 return self.get_query_set()[: 40]31 return self.get_query_set()[:self.comment_count_limit] 31 32 32 33 class LatestCommentsFeed(LatestFreeCommentsFeed): 33 """Feed of latest free comments on the current site"""34 """Feed of latest comments on the current site.""" 34 35 35 36 comments_class = Comment 36 37