[Erp5-report] r29967 - in /erp5/trunk/products/ERP5: Document/ mixin/

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Oct 23 13:44:45 CEST 2009


Author: fabien
Date: Fri Oct 23 13:44:41 2009
New Revision: 29967

URL: http://svn.erp5.org?rev=29967&view=rev
Log:
before, a web_page accessed through web_section or through
web_page_module where served using a different cache. This was due to the fact
that web_page.getPath() was used as key to find the corresponding cache (and
the path of a web page is not the same through web_page_module and through a
web_site). Now, orginal_path is stored on web_section and used
instead of path. This permit to served cached web_page throught web_page_module
or throught a web_site.

Modified:
    erp5/trunk/products/ERP5/Document/WebSection.py
    erp5/trunk/products/ERP5/mixin/cached_convertable.py

Modified: erp5/trunk/products/ERP5/Document/WebSection.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/WebSection.py?rev=29967&r1=29966&r2=29967&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/WebSection.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/WebSection.py [utf8] Fri Oct 23 13:44:41 2009
@@ -196,6 +196,7 @@
                 id=document.getReference(),
                 original_container=document.getParentValue(),
                 original_id=document.getId(),
+                original_path=document.getPath(),
                 editable_absolute_url=document.absolute_url())).__of__(self)
         # Try to use a custom renderer if any
         custom_render_method_id = self.getCustomRenderMethodId()

Modified: erp5/trunk/products/ERP5/mixin/cached_convertable.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/mixin/cached_convertable.py?rev=29967&r1=29966&r2=29967&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/mixin/cached_convertable.py [utf8] (original)
+++ erp5/trunk/products/ERP5/mixin/cached_convertable.py [utf8] Fri Oct 23 13:44:41 2009
@@ -146,7 +146,8 @@
     if self.isTempObject():
       return getattr(aq_base(self), 'temp_conversion_data', {})[cache_id]
     for cache_plugin in self._getCacheFactory().getCachePluginList():
-      cache_entry = cache_plugin.get(self.getPath(), DEFAULT_CACHE_SCOPE)
+      document_path = getattr(self, 'original_path', self.getPath())
+      cache_entry = cache_plugin.get(document_path, DEFAULT_CACHE_SCOPE)
       data_list = cache_entry.getValue().get(cache_id)
       if data_list:
         md5sum, mime, data = data_list




More information about the Erp5-report mailing list