provide a collection of sub-parts of a page that may be placed separately on the page

This commit is contained in:
Helmut Merz 2016-01-17 14:16:24 +01:00
parent cd65a3f7b5
commit 396d4727dc
2 changed files with 13 additions and 0 deletions

View file

@ -192,6 +192,7 @@ class BaseView(GenericView, I18NView, SortableMixin):
actions = {} actions = {}
portlet_actions = [] portlet_actions = []
parts = () parts = ()
subparts = ()
icon = None icon = None
modeName = 'view' modeName = 'view'
isToplevel = False isToplevel = False

View file

@ -98,6 +98,18 @@ class NodeView(BaseView):
def macro(self): def macro(self):
return self.template.macros['content'] return self.template.macros['content']
@Lazy
def subparts(self):
def getParts(n):
t = n.targetObjectView
if t is None:
return []
return t.subparts
parts = getParts(self)
for n in self.textItems:
parts.extend(getParts(n))
return parts
def update(self): def update(self):
result = super(NodeView, self).update() result = super(NodeView, self).update()
self.recordAccess() self.recordAccess()