Commit e0bb4bde authored by Cédric Le Ninivin's avatar Cédric Le Ninivin

erp5_web: use Base_getWebDocumentDrivenModificationDate to get last Modified Date

parent 017770a1
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>from Products.ERP5Type.Cache import CachingMethod\n
\n
def getLatestModificationDate():\n
document = context.getPortalObject().portal_catalog(\n
portal_type=("Web Page", "Web Section", "Web Site", "Image"),\n
sort_on=((\'modification_date\', \'descending\'),),\n
select_list=(\'modification_date\',),\n
limit=1,\n
)\n
return document[0].modification_date\n
\n
getLatestModificationDate = CachingMethod(\n
getLatestModificationDate,\n
id="Base_getWebDocumentDrivenModificationDate",\n
cache_factory="erp5_content_short",\n
)\n
\n
return getLatestModificationDate()\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_getWebDocumentDrivenModificationDate</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -255,7 +255,7 @@ ...@@ -255,7 +255,7 @@
</item> </item>
<item> <item>
<key> <string>_max_age_secs</string> </key> <key> <string>_max_age_secs</string> </key>
<value> <int>300</int> </value> <value> <int>600</int> </value>
</item> </item>
<item> <item>
<key> <string>_mtime_func</string> </key> <key> <string>_mtime_func</string> </key>
...@@ -319,6 +319,14 @@ ...@@ -319,6 +319,14 @@
<none/> <none/>
</value> </value>
</item> </item>
<item>
<key> <string>_stale_if_error_secs</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>_stale_while_revalidate_secs</string> </key>
<value> <int>0</int> </value>
</item>
<item> <item>
<key> <string>_vary</string> </key> <key> <string>_vary</string> </key>
<value> <string>Accept-Language, Cookie</string> </value> <value> <string>Accept-Language, Cookie</string> </value>
...@@ -433,7 +441,7 @@ ...@@ -433,7 +441,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>text</string> </key> <key> <string>text</string> </key>
<value> <string>python: getattr(object, \'getModificationDate\', object.modified)()</string> </value> <value> <string>python: getattr(object, \'Base_getWebDocumentDrivenModificationDate\', object.modified)()</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment