# HG changeset patch # User Brian Neal # Date 1268623598 0 # Node ID 9b63ad1f2ad2bc231db60efc06f8f3519cef3a21 # Parent b7ac381996e8da63bc6d62fd916db97aaf00a0ff Fixing #59, again. Django ticket 13093 was fixed allowing cache_page to work in the URLconf. diff -r b7ac381996e8 -r 9b63ad1f2ad2 gpp/forums/feeds.py --- a/gpp/forums/feeds.py Thu Mar 11 02:34:07 2010 +0000 +++ b/gpp/forums/feeds.py Mon Mar 15 03:26:38 2010 +0000 @@ -3,8 +3,6 @@ from django.contrib.syndication.views import Feed from django.core.exceptions import ObjectDoesNotExist from django.shortcuts import get_object_or_404 -from django.utils.decorators import method_decorator -from django.views.decorators.cache import cache_page from forums.models import Forum from forums.models import Post @@ -18,10 +16,6 @@ author_name = 'Brian Neal' author_email = 'admin@surfguitar101.com' - @method_decorator(cache_page(15 * 60)) - def __call__(self, request, *args, **kwargs): - return super(ForumsFeed, self).__call__(request, *args, **kwargs) - def get_object(self, request, forum_slug): # only return public forums if forum_slug: diff -r b7ac381996e8 -r 9b63ad1f2ad2 gpp/news/feeds.py --- a/gpp/news/feeds.py Thu Mar 11 02:34:07 2010 +0000 +++ b/gpp/news/feeds.py Mon Mar 15 03:26:38 2010 +0000 @@ -2,8 +2,6 @@ This file contains the feed classes for the news application. """ from django.contrib.syndication.views import Feed -from django.utils.decorators import method_decorator -from django.views.decorators.cache import cache_page from news.models import Story from core.functions import get_full_name @@ -20,10 +18,6 @@ author_name = 'Brian Neal' author_email = 'admin@surfguitar101.com' - @method_decorator(cache_page(4 * 60 * 60)) - def __call__(self, request, *args, **kwargs): - return super(LatestNewsFeed, self).__call__(request, *args, **kwargs) - def feed_copyright(self): return copyright_str() diff -r b7ac381996e8 -r 9b63ad1f2ad2 gpp/urls.py --- a/gpp/urls.py Thu Mar 11 02:34:07 2010 +0000 +++ b/gpp/urls.py Mon Mar 15 03:26:38 2010 +0000 @@ -1,6 +1,7 @@ from django.conf.urls.defaults import * from django.conf import settings from django.contrib import admin +from django.views.decorators.cache import cache_page from news.feeds import LatestNewsFeed from forums.feeds import ForumsFeed @@ -20,14 +21,14 @@ (r'^donations/', include('donations.urls')), (r'^downloads/', include('downloads.urls')), url(r'^feeds/news/$', - LatestNewsFeed(), + cache_page(LatestNewsFeed(), 6 * 60 * 60), name='feeds-news'), url(r'^feeds/forums/$', - ForumsFeed(), + cache_page(ForumsFeed(), 1 * 60 * 60), {'forum_slug': None}, 'feeds-forum_combined'), url(r'^feeds/forums/(?P[\w\d-]+)/$', - ForumsFeed(), + cache_page(ForumsFeed(), 1 * 60 * 60), name='feeds-forum'), (r'^forums/', include('forums.urls')), (r'^irc/', include('irc.urls')),