Hi!<br>Some one could help me to construct a correct __bobo_traverse__ or wrapper for my necesities.<br><br>The clues:<br><br>I have this model of __bobo_traverse__:<br><br>def __bobo_traverse__(self, REQUEST, nombre):<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; obj = getattr(self, nombre, None)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if obj is None: <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; self.REQUEST.set(&#39;TraversalRequestNameStack&#39;, self.REQUEST[&quot;TraversalRequestNameStack&quot;] + [nombre])<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if hasattr(self, &#39;
index.html&#39;): return getattr(self, &#39;index.html&#39;)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; else:<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; resultado = self.__call__()<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if type(resultado) == type(unicode()): return WrapperUnicode(resultado)<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; elif type(resultado) == type(str()): return WrapperStr(resultado)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; elif type(resultado) == type(dict()): return WrapperDict(resultado)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; else: return resultado<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return obj
<br><br>With this Wrapper classes:<br><br>class WrapperStr(str):<br>&nbsp;&nbsp;&nbsp; &quot;&quot;&quot; &quot;&quot;&quot;<br>&nbsp;&nbsp;&nbsp; __roles__ = None<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; def __bobo_traverse__(self, REQUEST, nombre):<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; obj = getattr(self, nombre, None)
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if obj is None: return self<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; else: return obj<br>&nbsp;&nbsp;&nbsp; <br>class WrapperUnicode(unicode):<br>&nbsp;&nbsp;&nbsp; &quot;&quot;&quot; &quot;&quot;&quot;<br>&nbsp;&nbsp;&nbsp; __roles__ = None<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; def __init__(self, cadena):
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; self.cadena = cadena<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; def __bobo_traverse__(self, REQUEST, nombre):<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; obj = getattr(self, nombre, None)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if obj is None: return self<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; else: return obj.__of__(self)<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; def __call__(self):<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return self.cadena<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; def __str__(self):<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return str(self.cadena.decode(&#39;latin-1&#39;))<br><br>class WrapperDict(dict):<br>&nbsp;&nbsp;&nbsp; &quot;&quot;&quot; &quot;&quot;&quot;
<br>&nbsp;&nbsp;&nbsp; __roles__ = None<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; def __bobo_traverse__(self, REQUEST, nombre):<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; obj = getattr(self, nombre, None)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if obj is None: return self<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; else: return obj<br><br>With this version I have the security problem I&#39;m asking this days. The last opinion was the Wrapper classes are the problem but you could see the wrappers I can do with the information I have
<br><br>But if I change the __bobo_traverse__ to this:<br><br>def __bobo_traverse__(self, REQUEST, nombre):<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; obj = getattr(self, nombre, None)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if obj is None: <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; self.REQUEST.set(&#39;TraversalRequestNameStack&#39;, 
self.REQUEST[&quot;TraversalRequestNameStack&quot;] + [nombre])<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if hasattr(self, &#39;index.html&#39;): return getattr(self, &#39;index.html&#39;)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; else:<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; obj = getattr(self, &#39;lanzador&#39;, None)
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return obj<br><br>Where lanzador is a page template with this code:<br><br>&lt;tal:b tal:replace=&#39;structure here&#39; /&gt;<br><br>Then it works perfect!! (we can conclude, then, that Martijn has good clues about the problem, thanks again!)
<br><br>Here my petition of help:<br><br>Could someone explain or point me to how the wrappers need to be? I don&#39;t like so much the idea that all my work depends on a page template with 1 line of code if I could implement it at product code
<br><br>Thank you!<br clear="all"><br>-- <br>Mis Cosas<br><a href="http://blogs.sistes.net/Garito">http://blogs.sistes.net/Garito</a>