This repository has been archived on 2023-02-21. You can view files and clone it, but cannot push or open issues or pull requests.
cmsplugin-blurp/src/cmsplugin_blurp/renderers/data_source_list.py

20 lines
607 B
Python

import logging
log = logging.getLogger(__name__)
from . import data_source
class Renderer(data_source.Renderer):
"""
Aggregates all data from the sources into a list and expose them to the
template with the name of its slug
"""
def render(self, context):
context[self.slug] = []
for slug, data in self.get_sources(context):
try:
context[self.slug].append(data.content)
except Exception as e:
log.exception("exception occured while extending the list: %s", e)
return super(Renderer, self).render(context)