provide generalized access to children for use by navigation levels
git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@3304 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
parent
e179848ad6
commit
b82f776b0b
2 changed files with 11 additions and 1 deletions
|
@ -28,6 +28,7 @@ from zope.app.security.interfaces import IUnauthenticatedPrincipal
|
|||
from zope import component
|
||||
from zope.cachedescriptors.property import Lazy
|
||||
from zope.proxy import removeAllProxies
|
||||
from zope.security.proxy import removeSecurityProxy
|
||||
from zope.traversing.browser import absoluteURL
|
||||
|
||||
from loops.common import adapted
|
||||
|
@ -38,9 +39,17 @@ from loops import util
|
|||
class BaseView(object):
|
||||
|
||||
def __init__(self, context, request):
|
||||
self.context = context # this is the adapted concept!
|
||||
self.context = removeSecurityProxy(context) # this is the adapted concept!
|
||||
self.request = request
|
||||
|
||||
@Lazy
|
||||
def viewAnnotations(self):
|
||||
return self.request.annotations.get('loops.view', {})
|
||||
|
||||
@Lazy
|
||||
def virtualTarget(self):
|
||||
return self.viewAnnotations.get('target')
|
||||
|
||||
@Lazy
|
||||
def title(self):
|
||||
return self.context.title
|
||||
|
|
|
@ -41,6 +41,7 @@ class ConceptView(BaseView):
|
|||
@property
|
||||
def children(self):
|
||||
for c in self.context.getChildren():
|
||||
a = adapted(c)
|
||||
view = component.getMultiAdapter((c, self.request), name='layout')
|
||||
view.node = self.node
|
||||
yield view
|
||||
|
|
Loading…
Add table
Reference in a new issue