On Tue, 2007-02-27 at 13:20 -0600, GaRaGeD Style wrote: > Hi all > > I'm really not good at python, and hence not good at django, but I > really love both :) > > I have spent a few hours trying to understand why this works: > ------------------ > @login_required > def object_list(request, model, page): > try: > return list_detail.object_list( > request, > queryset = model.objects.all().order_by('name'), > template_name = 'base/%s_list.html' % > model.__name__.lower(), > paginate_by = 3, > page = page, > ) > except: > return HttpResponseRedirect('/list/people/') > > object_list = cache_page(object_list, 300) > --------------------------------- > > And this doesnt: > ----------------------------- > @cache(600) > @login_required > def object_list(request, model, page): > try: > return list_detail.object_list( > request, > queryset = model.objects.all().order_by('name'), > template_name = 'base/%s_list.html' % > model.__name__.lower(), > paginate_by = 3, > page = page, > ) > except: > return HttpResponseRedirect('/list/people/') > ---------------------------------
Assuming this is a cut-and-paste of your actual code, you have mispelt the decorator name, haven't you? It should be @cache_page(600) (the same name as in your first example). Regards, Malcolm --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---