Re: [Zope-dev] __bobo_traverse__, restrictedTraverse and PageTemplates

2002-04-02 Thread Florent Guillaume

Shane Hathaway  <[EMAIL PROTECTED]> wrote:
> > If anybody has any lights on how I can write 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?

Yes, TALES traversal. Actually I didn't even get to see the object
through the web because the error occured in the view method.

> Have you considered implementing __getitem__() instead of 
> __bobo_traverse__()?

No I hadn't, but I should have ! Thanks for the idead, for my needs it
does the job perfectly.

> 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.

I believe it's wrong too, but at this point there's too much voodoo in
these parts of Zope that it'll take Zope 3 to clean all that up :)


Florent
-- 
Florent Guillaume, Nuxeo (Paris, France)
+33 1 40 33 79 10  http://nuxeo.com  mailto:[EMAIL PROTECTED]

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] __bobo_traverse__, restrictedTraverse and PageTemplates

2002-04-02 Thread Shane Hathaway

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


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )