Django

Code

Show
Ignore:
Timestamp:
08/24/08 23:52:55 (3 months ago)
Author:
mtredinnick
Message:

Fixed #7460 -- Made the "cache" template tag always generate keys that can be
used with the memcache backend (which has the strongest restriction on keys).
Based on a patch from trbs.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/templatetags/cache.py

    r7754 r8533  
    33from django.core.cache import cache 
    44from django.utils.encoding import force_unicode 
     5from django.utils.http import urlquote 
    56 
    67register = Library() 
     
    2324            raise TemplateSyntaxError('"cache" tag got a non-integer timeout value: %r' % expire_time) 
    2425        # Build a unicode key for this fragment and all vary-on's. 
    25         cache_key = u':'.join([self.fragment_name] + [force_unicode(resolve_variable(var, context)) for var in self.vary_on]) 
     26        cache_key = u':'.join([self.fragment_name] + [urlquote(resolve_variable(var, context)) for var in self.vary_on]) 
    2627        value = cache.get(cache_key) 
    2728        if value is None: