[Zope] __bobo_traverse__ and wrappers
Garito
garito at sistes.net
Fri Feb 23 09:31:26 EST 2007
This is the 3th time I send this message (I experiencing problems with
google apps for your domain) If you recive this messege duplicate or
triplicate I ask you sorry!
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/20070223/0e3ddabd/attachment.htm
More information about the Zope
mailing list