[Checkins] SVN: lovely.viewcache/trunk/src/lovely/viewcache/view.py Make it possible to overwrite cachingKey

Jürgen Kartnaller juergen at kartnaller.at
Wed Feb 21 02:48:53 EST 2007


Log message for revision 72738:
  Make it possible to overwrite cachingKey
  

Changed:
  U   lovely.viewcache/trunk/src/lovely/viewcache/view.py

-=-
Modified: lovely.viewcache/trunk/src/lovely/viewcache/view.py
===================================================================
--- lovely.viewcache/trunk/src/lovely/viewcache/view.py	2007-02-21 06:59:58 UTC (rev 72737)
+++ lovely.viewcache/trunk/src/lovely/viewcache/view.py	2007-02-21 07:48:53 UTC (rev 72738)
@@ -45,8 +45,6 @@
             self._cachingOn = value
         return property(get, set)
 
-    cachingKey = None
-
     @property
     def staticCachingDeps(self):
         return getattr(super(CacheMixinBase, self),
@@ -79,7 +77,9 @@
             cache = self.getCache()
             if cache is not None:
                 result = cache.query(self._getCachePath(),
-                                     dict(key=self.cachingKey))
+                                     dict(key=getattr(self,
+                                                     'cachingKey',
+                                                     None)))
                 if result is not None:
                     self.__cachedValue__ = result
         return self.__cachedValue__ is not None
@@ -93,7 +93,7 @@
                 deps.update(self.dynamicCachingDeps)
                 cache.set(value,
                           self._getCachePath(),
-                          dict(key=self.cachingKey),
+                          dict(key=getattr(self, 'cachingKey', None)),
                           lifetime=self.lifetime,
                           dependencies=deps)
 



More information about the Checkins mailing list