[Zope] Re: use traversed subpath to insert REQUEST variables

Evan Simpson evan at 4-am.com
Thu Sep 11 12:33:09 EDT 2003


Tobias Herp wrote:
> thanks for answering. I hoped to avoid the AccessRule thing and have a 
> solution inside my portal product

This is actually very easy!  The BeforeTraverse machinery will call a 
'__before_publishing_traverse__' method defined in an object's class, 
even if the object has AccessRules or other contents that use this hook.

Example:

class MyClass:
     ...stuff...

     def __before_publishing_traverse__(self, request):
         # Do something with the request, such as fool with
         # request['TraversalRequestNameStack'].
         # The return value doesn't matter.

Cheers,

Evan @ 4-am





More information about the Zope mailing list