[Zope] __bobo_traverse__ and wrappers
Garito
garito at sistes.net
Thu Feb 22 07:51:42 EST 2007
Hi all!
Some days ago I begin this threat:
http://www.mail-archive.com/zope@zope.org/msg26355.html
Dieter point me to the solution and I try something like:
def __bobo_traverse__(self, REQUEST, nombre):
obj = getattr(self, nombre, None)
if obj is None:
self.REQUEST.set('TraversalRequestNameStack',
self.REQUEST["TraversalRequestNameStack"]
+ [nombre])
resultado = self()
if type(resultado) == type(unicode()): return
WrapperUnicode(resultado)
elif type(resultado) == type(str()): return
WrapperStr(resultado)
else: return resultado
return obj
and the wrappers:
class WrapperStr(str):
__roles__ = None
class WrapperUnicode(unicode):
__roles__ = None
But when I try to launch this zope raises a NotFound exception
If I inspect de content of resultado I could see an unicode string then the
WrapperUnicode is used to wrap the result
Can you point me where the problem is, please?
Thanks a lot!
--
Mis Cosas
http://blogs.sistes.net/Garito
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope/attachments/20070222/c8e15e06/attachment.htm
More information about the Zope
mailing list