allow suppression of controller set-up when creating target view, e.g. when creating view for breadcrumbs item
This commit is contained in:
parent
fd48e3f329
commit
6f996004c7
2 changed files with 4 additions and 4 deletions
|
@ -444,12 +444,12 @@ class NodeView(BaseView):
|
|||
def targetRender(self):
|
||||
return u'<div>%s</div>' % self.targetView('download.html', 'show')
|
||||
|
||||
def getViewForTarget(self, obj):
|
||||
def getViewForTarget(self, obj, setup=True):
|
||||
if obj is not None:
|
||||
basicView = component.getMultiAdapter((obj, self.request))
|
||||
if obj == self.targetObject:
|
||||
basicView._viewName = self.context.viewName
|
||||
#if self.context.nodeType != 'text':
|
||||
if setup:
|
||||
basicView.setupController()
|
||||
if hasattr(basicView, 'view'):
|
||||
return basicView.view
|
||||
|
|
|
@ -164,7 +164,7 @@ class ResourceView(BaseView):
|
|||
@Lazy
|
||||
def breadcrumbsParent(self):
|
||||
for c in self.context.getConcepts([self.defaultPredicate]):
|
||||
return self.nodeView.getViewForTarget(c)
|
||||
return self.nodeView.getViewForTarget(c, setup=False)
|
||||
|
||||
@Lazy
|
||||
def view(self):
|
||||
|
|
Loading…
Add table
Reference in a new issue