[z3-five] Re: Traversal issue [was: 0.2 release]
Sidnei da Silva
sidnei at awkly.org
Mon Oct 4 13:55:35 MEST 2004
| I'm rather horrified such a thing should be necessary, and also
| concerned about performance implications.
|
| I'm confused why we need to do all this special work while Zope itself
| does not. Zope doesn't have any code unwrapping the call stack just to
| determine how the code was called, right? What's different here?
No 'sane' code seems to implement __bobo_traverse__. In fact, I
couldn't find a example of how it should look like. It's really
annoying that the consumers of __bobo_traverse__ expect it to always
return something and never raise an exception.
An idea just occurred me: We could try to return an dummy object which
doesn't have __bobo_traverse__ and then:
- Raise NotFound when the object is published by ZPublisher
- Raise AttributeError/KeyError when restrictedTraverse tries to
traverse further on that object.
That seems to be a bit cleaner, and doesn't break any assumptions made
by __bobo_traverse__.
--
Sidnei da Silva <sidnei at awkly.org>
http://awkly.org - dreamcatching :: making your dreams come true
http://www.enfoldsystems.com
http://plone.org/about/team#dreamcatcher
Why use Windows, since there is a door?
(By fachat at galileo.rhein-neckar.de, Andre Fachat)
More information about the z3-five
mailing list