make access to parents more tolerant to allow breadcrumbs for views that don't have a content/root object

git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@3216 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
helmutm 2009-02-08 10:36:40 +00:00
parent 70ec37efb8
commit 256597a928
2 changed files with 3 additions and 2 deletions

View file

@ -104,7 +104,7 @@ class ItemView(BaseView):
@property
def breadCrumbs(self):
parents = list(self.context.parents)
parents = [p for p in self.context.parents if p is not None]
for p in reversed(parents):
view = ItemView(p, self.request, self.parentView)
yield dict(url=view.url, title=view.title)

View file

@ -166,7 +166,8 @@ class BSCWProxyBase(object):
return
parentId = self.properties['location']['__id__'].lstrip('bs_')
p = self.connection.getProxy(address=parentId, nested=False)
while parentId != self.connection.rootId:
while p is not None and parentId != self.connection.rootId:
#while parentId != self.connection.rootId:
yield p
parentId = p.properties['location']['__id__'].lstrip('bs_')
p = self.connection.getProxy(address=parentId)