1 from engine.plugin import Plugin
3 class Composite (Plugin):
5 def __init__ (self, sons=[], *args, **kwds):
6 Plugin.__init__ (self, *args, **kwds)
9 def insert (self, plugin):
10 self.sons.append(plugin)
12 def template_env (self, request):
13 # this is designed so as to support a template like
14 # {% for son in sons %} {{ son.rendered }} ...
16 [ { 'rendered': son.render(request),
19 for son in self.sons ]}
21 # xxx need a way to select an active son, like e.g.
22 # Composite (active='some string')
23 # and we could then try to find that string in either title or uuid or some other place
24 # in which case the corresponding 'son' entry in template_env above would son.active=True