Cache content by modification date and review state

This commit is contained in:
Nicolas Demonte 2019-04-05 13:56:22 +02:00
parent 2ae6448b9b
commit 7b6b2ea503
1 changed files with 4 additions and 1 deletions

View File

@ -36,7 +36,10 @@ class Column(z3c.table.column.Column, grok.MultiAdapter):
def _get_value_cachekey(method, request, item, attribute, default=None):
return (item.getPath(), request.__dict__, attribute, default)
path = item.getPath()
review_state = getattr(item, 'review_state', '')
modified = getattr(item, 'modified', None) or getattr(item, 'ModificationDate', None)
return (path, modified, review_state, attribute, default)
@ram.cache(_get_value_cachekey)