Comment

Henri Witteveen

I was quite thrilled to find your django-fancy-cache solution and I included django-fancy-cache in my view file. I am using to add a datetime key_prefix to the cache_key. My view function also expects a few kwargs:

from fancy_cache import cache_page

def latest_business_entry(request, *args, **kwargs):
...
return return_date_string

@cache_page(settings.SHOW_ALL_BRANCH_CACHE_SECONDS, key_prefix=latest_business_entry)
def show_all(request, template, inet_code=None, language_code=None)

However in the function latest_business_entry I am getting an "KeyError" error. Now it appears the kwargs dict is empty so it seems cache_page is ignoring kwargs. Is this true or am I doing something wrong?

Replies

Peter Bengtsson

Hmm.. That could be a bug. We should fix that.

Just to confirm, you're saying that `template, inet_code=None, language_code=None` etc is not passed into latest_business_entry()?