[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/Caching/Views/Browser - CacheableView.py:1.3

Viktorija Zaksiene ryzaja@codeworks.lt
Tue, 3 Dec 2002 03:55:53 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/App/Caching/Views/Browser
In directory cvs.zope.org:/tmp/cvs-serv5269/lib/python/Zope/App/Caching/Views/Browser

Modified Files:
	CacheableView.py 
Log Message:
Caches now want object's location, not the object itself.


=== Zope3/lib/python/Zope/App/Caching/Views/Browser/CacheableView.py 1.2 => 1.3 ===
--- Zope3/lib/python/Zope/App/Caching/Views/Browser/CacheableView.py:1.2	Mon Nov 11 15:57:20 2002
+++ Zope3/lib/python/Zope/App/Caching/Views/Browser/CacheableView.py	Tue Dec  3 03:55:53 2002
@@ -18,7 +18,7 @@
 
 from Zope.App.Caching.ICacheable import ICacheable
 from Zope.App.OFS.Annotation.IAnnotatable import IAnnotatable
-from Zope.App.Caching.Caching import getCacheForObj
+from Zope.App.Caching.Caching import getCacheForObj, getLocationForCache
 from Zope.App.PageTemplate import ViewPageTemplateFile
 from Zope.Publisher.Browser.BrowserView import BrowserView
 from Zope.App.Forms.Widget import CustomWidget
@@ -45,8 +45,9 @@
         "Invalidate the current cached value."
 
         cache = getCacheForObj(self.context)
-        if cache:
-            cache.invalidate(self.context)
+        location = getLocationForCache(self.context)
+        if cache and location:
+            cache.invalidate(location)
             return self.form(message="Invalidated.")
         else:
             return self.form(message="No cache associated with object.")