[Zope-dev] __bobo_traverse__, restrictedTraverse and PageTemplates
Shane Hathaway
shane@zope.com
Tue, 02 Apr 2002 10:33:54 -0500
Florent Guillaume wrote:
> So I don't understand the different treatments, with bobo_traverse I get
> a None container, which makes the validate fail, whereas standard
> traversal calls ac_acquire with as a filter validate2, the filters
> receives a container, and this validation suceeds.
>
> If anybody has any lights on how I write do the __bobo_traverse__ I
> need...
I'm assuming you're using TALES traversal as opposed to ZPublisher
traversal, right? It lets you view the objects directly through the
web, doesn't it?
Have you considered implementing __getitem__() instead of
__bobo_traverse__()? __bobo_traverse__() is messy. I'm inclined to
tell you the restrictedTraverse() method is wrong, and that container
should be computed as the aq_inner of the aq_parent, but we something
might depend on the current behavior.
Shane