[Zope-CMF] __bobo_traverse__ problem

Dieter Maurer dieter@handshake.de
Tue, 13 Aug 2002 21:55:00 +0200


Geoff Davis writes:
 > ...
 > class FormTool(UniqueObject, SimpleItem):
 > 
 >     id = 'portal_form'
 >     meta_type= 'Plone Form Tool'
 >     security = ClassSecurityInfo()
 >     security.declarePublic('__bobo_traverse__')
 > 
 >     # An implementation of __bobo_traverse__ that does nothing interesting
 >     def __bobo_traverse__(self, REQUEST, name):
 >         """ """
 >         return getattr(self, name)
 > ...
 > Traceback:
 > ...
 > 2.5.1\lib\python\Products\PageTemplates\Expressions.py, line 324, in
 > restrictedTraverse
 >     (Object: portal_form)
 >     (Info: {'path': ['portal_properties'], 'TraversalRequestNameStack': []})
 > Unauthorized: You are not allowed to access portal_properties in this
 > context
I expect the "getattr" above constructs a strange acquisition
structure.

You can use Shane's "showaq" method to analyse the acquisition structure.


Dieter