From 05d4e5d810642102e27d199f3ce8c145654ac8dd Mon Sep 17 00:00:00 2001 From: Adolfo Fitoria Date: Thu, 19 Jan 2012 12:02:37 -0300 Subject: fixed feed issues with cache. --- askbot/feed.py | 25 +++++++++++----------- .../skins/default/templates/main_page/tab_bar.html | 4 ++-- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/askbot/feed.py b/askbot/feed.py index c1933afe..6df9b8aa 100644 --- a/askbot/feed.py +++ b/askbot/feed.py @@ -26,7 +26,7 @@ class RssIndividualQuestionFeed(Feed): """rss feed class for particular questions """ title = askbot_settings.APP_TITLE + _(' - ')+ _('Individual question feed') - link = askbot_settings.APP_URL + #link = askbot_settings.APP_URL description = askbot_settings.APP_DESCRIPTION copyright = askbot_settings.APP_COPYRIGHT @@ -34,11 +34,11 @@ class RssIndividualQuestionFeed(Feed): if len(bits) != 1: raise ObjectDoesNotExist return Post.objects.get_questions().get(id__exact = bits[0]) - + def item_link(self, item): """get full url to the item """ - return self.link + item.get_absolute_url() + return askbot_settings.APP_URL + item.get_absolute_url() def item_pubdate(self, item): """get date of creation for the item @@ -56,7 +56,6 @@ class RssIndividualQuestionFeed(Feed): chain_elements.append( Post.objects.get_comments().filter(parent=item) ) - answers = Post.objects.get_answers().filter(thread = item.thread) for answer in answers: chain_elements.append([answer,]) @@ -65,7 +64,7 @@ class RssIndividualQuestionFeed(Feed): ) return itertools.chain(*chain_elements) - + def item_title(self, item): """returns the title for the item """ @@ -77,7 +76,7 @@ class RssIndividualQuestionFeed(Feed): elif item.post_type == "comment": title = "Comment by %s for %s" % (item.author, self.title) return title - + def item_description(self, item): """returns the description for the item """ @@ -88,7 +87,7 @@ class RssLastestQuestionsFeed(Feed): """rss feed class for the latest questions """ title = askbot_settings.APP_TITLE + _(' - ')+ _('latest questions') - link = askbot_settings.APP_URL + #link = askbot_settings.APP_URL description = askbot_settings.APP_DESCRIPTION #ttl = 10 copyright = askbot_settings.APP_COPYRIGHT @@ -96,7 +95,7 @@ class RssLastestQuestionsFeed(Feed): def item_link(self, item): """get full url to the item """ - return self.link + item.get_absolute_url() + return askbot_settings.APP_URL + item.get_absolute_url() def item_author_name(self, item): """get name of author @@ -117,8 +116,8 @@ class RssLastestQuestionsFeed(Feed): """returns url without the slug because the slug can change """ - return self.link + item.get_absolute_url(no_slug = True) - + return askbot_settings.APP_URL + item.get_absolute_url(no_slug = True) + def item_description(self, item): """returns the desciption for the item """ @@ -142,12 +141,12 @@ class RssLastestQuestionsFeed(Feed): if tags: #if there are tags in GET, filter the #questions additionally - for tag in tags: + for tag in tags: qs = qs.filter(thread__tags__name = tag) - + return qs.order_by('-thread__last_activity_at')[:30] - + def main(): """main function for use as a script diff --git a/askbot/skins/default/templates/main_page/tab_bar.html b/askbot/skins/default/templates/main_page/tab_bar.html index 8b666155..17ab810e 100644 --- a/askbot/skins/default/templates/main_page/tab_bar.html +++ b/askbot/skins/default/templates/main_page/tab_bar.html @@ -3,9 +3,9 @@ {% cache 0 "scope_sort_tabs" search_tags request.user author_name scope sort query context.page language_code %} {% trans %}RSS{% endtrans %} -- cgit v1.2.3-1-g7c22