[Zope3-checkins]
SVN: Zope3/trunk/src/zope/app/cache/annotationcacheable.py
Fix a bug in AnnotationCacheable
Roger Ineichen
roger at projekt01.ch
Mon Jul 12 21:48:58 EDT 2004
Log message for revision 26439:
Fix a bug in AnnotationCacheable
In the AnnotationCacheable view the method setCacheId wasn't able to write into the __annotation__.
Added removeAllProxies for to make shure the annotation can be accessed if no BTree was set.
Changed:
U Zope3/trunk/src/zope/app/cache/annotationcacheable.py
-=-
Modified: Zope3/trunk/src/zope/app/cache/annotationcacheable.py
===================================================================
--- Zope3/trunk/src/zope/app/cache/annotationcacheable.py 2004-07-13 00:34:17 UTC (rev 26438)
+++ Zope3/trunk/src/zope/app/cache/annotationcacheable.py 2004-07-13 01:48:58 UTC (rev 26439)
@@ -16,6 +16,7 @@
$Id$
"""
from zope.interface import implements
+from zope.proxy import removeAllProxies
from zope.app import zapi
from zope.app.annotation.interfaces import IAnnotations
@@ -41,7 +42,7 @@
if old_cache_id and old_cache_id != id:
cache = zapi.getUtility(ICache, old_cache_id)
cache.invalidate(self._context)
- annotations = IAnnotations(self._context)
+ annotations = IAnnotations(removeAllProxies(self._context))
annotations[annotation_key] = id
cacheId = property(getCacheId, setCacheId, None, "Associated cache name")
More information about the Zope3-Checkins
mailing list