Ticket #13672: tcache.diff
File tcache.diff, 930 bytes (added by , 14 years ago) |
---|
-
django/templatetags/cache.py
24 24 except (ValueError, TypeError): 25 25 raise TemplateSyntaxError('"cache" tag got a non-integer timeout value: %r' % expire_time) 26 26 # Build a unicode key for this fragment and all vary-on's. 27 args = md5_constructor(u':'.join([urlquote(resolve_variable(var, context)) for var in self.vary_on])) 27 keys = "" 28 for var in self.vary_on: 29 try: 30 keys += ":" + urlquote(resolve_variable(var, context)) 31 except: 32 keys += ":None" 33 args = md5_constructor(keys) 28 34 cache_key = 'template.cache.%s.%s' % (self.fragment_name, args.hexdigest()) 29 35 value = cache.get(cache_key) 30 36 if value is None: