Before the Django 1.2 beta and the class-based Feed views, I was doing
this to cache my RSS feeds:

urls.py:
from django.contrib.syndication.views import feed as syndication_feed
from django.views.decorators.cache import cache_page

urlpatterns = patterns('',
   url(r'^feeds/(?P<url>.*)/$',
      cache_page(syndication_feed, 60 * 15),
      {'feed_dict': feeds},
      'feeds-news'),

Is there a way to do something similar to this now with the 1.2 Feed
classes? This doesn't seem to work when the argument to cache_page is
now an instance of a Feed object (I get an AttributeError; my feed
class has no attribute '__name__'):

   url(r'^feeds/news/$',
       cache_page(LatestNewsFeed(), 60 * 15),
       name='feeds-news'),

Or am I going about this wrong and I need to put the cache_page
decorator on an overridden __call__ method on my derived Feed class
(which simply calls the base class)?

Thanks,
BN

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to