--- a/src/pyams_content/shared/view/__init__.py Mon Jul 02 17:11:55 2018 +0200
+++ b/src/pyams_content/shared/view/__init__.py Mon Jul 02 18:29:56 2018 +0200
@@ -18,6 +18,7 @@
logger = logging.getLogger("PyAMS (content)")
from datetime import datetime
+from itertools import tee
# import interfaces
from hypatia.interfaces import ICatalog
@@ -105,7 +106,8 @@
reverse if reverse is not None else self.reversed_order,
limit or self.limit)
intids = get_utility(IIntIds)
- views_cache.set_value(cache_key, [intids.queryId(item) for item in results])
+ cache, results = tee(results)
+ views_cache.set_value(cache_key, [intids.queryId(item) for item in cache])
logger.debug("Storing view items to cache key {0}".format(cache_key))
else:
results = CatalogResultSet(results)