<div dir="ltr">Yeah, Mustaha!<br>Sometimes I think I&#39;m a little stupid, jejejeje, I have in front of my nose but I don&#39;t see it<br><br>I was solved the problem adding a y: type expression and then subclass the PythonExpr with the __init__ method modified to change the expression<br>
<br>Too much difficult to do the job in an acceptable way<br><br>BUT!!!<br><br>If you go to usr/lib/zope&lt;version&gt;/lib/python/zope/tales/tales.py and change the 592 and 593:<br><br>591&nbsp;&nbsp;&nbsp; else:<br>592 &nbsp; &nbsp; &nbsp;&nbsp; type = &quot;standard&quot;<br>
593 &nbsp; &nbsp; &nbsp;&nbsp; expr = expression<br><br>to<br><br>else:<br>&nbsp;&nbsp;&nbsp; if expression.find(&#39;${&#39;) &gt; -1:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; type = &quot;python&quot;<br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; expr = &quot;path(path(&#39;string:%s&#39;))&quot; % expression<br>&nbsp;&nbsp;&nbsp; else:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; type = &quot;standard&quot;<br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; expr = expression<br><br>then you could use expressions like this<br><br>path/to/render/${with/some/variable}/and/the/rest/of/the/path<br><br>I think it&#39;s an acceptable change to the code for the job it does<br>
I don&#39;t know if Zope people will introduce this change but I think if not they will be wrong<br><br>But they are absolute free to do what they want to do, don&#39;t misunderstand me, please<br><br><div class="gmail_quote">
2008/8/12 mustapha <span dir="ltr">&lt;<a href="mailto:mustapha@headnet.dk">mustapha@headnet.dk</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
I&#39;m not sure I get what you want to do.<br>
<br>
It is not the page template that decides about the expression but the<br>
engine as Philpp explained before.<br>
<br>
anyway, I think you are looking for the &quot;compile&quot; method of the<br>
ExpressionEngine class (look in zope/tales/tales.py). It&#39;s there where<br>
the expressions are parsed.<br>
<br>
HTH<br>
<div class="Ih2E3d"><br>
Garito wrote:<br>
&gt; Yes, it&#39;s ok but I can save n variable definitions with 4 lines of code<br>
&gt; in 1 point<br>
&gt; Seems quite interesting for me<br>
&gt;<br>
&gt; Could someone point me were the page template decides if the expression<br>
&gt; is a standard, string, python, etc one, please? ;)<br>
&gt;<br>
&gt; 2008/8/11 Philipp von Weitershausen<br>
&gt; &lt;<a href="mailto:philipp@weitershausen.de">philipp@weitershausen.de</a><br>
</div>&gt; &lt;mailto:<a href="mailto:philipp@weitershausen.de">philipp@weitershausen.de</a>&gt;&gt;<br>
<div class="Ih2E3d">&gt;<br>
&gt; &nbsp; &nbsp; Garito wrote:<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; Considere this case:<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; I have the sking value in the variable at args/Yanged/Skin<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; How can I do the equivalent to<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; args/Yanged/raiz/Skins/${args/Yanged/Skin}/arbolYanged.css/absolute_url<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; ?<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; In the python way it will be:<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; path(path(&#39;string:&#39; +<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &#39;args/Yanged/raiz/Skins/${args/Yanged/Skin}/arbolYanged.css/absolute_url&#39;))<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; That&#39;s returns the expected value but I can&#39;t see how to do with your<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; propossed way<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; &lt;a tal:define=&quot;skin args/Yanged/Skin;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;file args/Yanged/raiz/Skins/?skin/arbolYanged.css&quot;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp;tal:attributes=&quot;href file/absolute_url&quot;&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; _______________________________________________<br>
&gt; &nbsp; &nbsp; Zope maillist &nbsp;- &nbsp;<a href="mailto:Zope@zope.org">Zope@zope.org</a><br>
</div>&gt; &nbsp; &nbsp; &lt;mailto:<a href="mailto:Zope@zope.org">Zope@zope.org</a>&gt;<br>
<div class="Ih2E3d">&gt; &nbsp; &nbsp; <a href="http://mail.zope.org/mailman/listinfo/zope" target="_blank">http://mail.zope.org/mailman/listinfo/zope</a><br>
&gt; &nbsp; &nbsp; ** &nbsp; No cross posts or HTML encoding! &nbsp;**<br>
&gt; &nbsp; &nbsp; (Related lists -<br>
&gt; &nbsp; &nbsp; &nbsp;<a href="http://mail.zope.org/mailman/listinfo/zope-announce" target="_blank">http://mail.zope.org/mailman/listinfo/zope-announce</a><br>
&gt; &nbsp; &nbsp; &nbsp;<a href="http://mail.zope.org/mailman/listinfo/zope-dev" target="_blank">http://mail.zope.org/mailman/listinfo/zope-dev</a> )<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Mis Cosas<br>
&gt; <a href="http://blogs.sistes.net/Garito" target="_blank">http://blogs.sistes.net/Garito</a><br>
&gt; Zope Smart Manager<br>
&gt; <a href="http://blogs.sistes.net/Garito/670" target="_blank">http://blogs.sistes.net/Garito/670</a><br>
&gt;<br>
&gt;<br>
</div>&gt; ------------------------------------------------------------------------<br>
<div><div></div><div class="Wj3C7c">&gt;<br>
&gt; _______________________________________________<br>
&gt; Zope maillist &nbsp;- &nbsp;<a href="mailto:Zope@zope.org">Zope@zope.org</a><br>
&gt; <a href="http://mail.zope.org/mailman/listinfo/zope" target="_blank">http://mail.zope.org/mailman/listinfo/zope</a><br>
&gt; ** &nbsp; No cross posts or HTML encoding! &nbsp;**<br>
&gt; (Related lists -<br>
&gt; &nbsp;<a href="http://mail.zope.org/mailman/listinfo/zope-announce" target="_blank">http://mail.zope.org/mailman/listinfo/zope-announce</a><br>
&gt; &nbsp;<a href="http://mail.zope.org/mailman/listinfo/zope-dev" target="_blank">http://mail.zope.org/mailman/listinfo/zope-dev</a> )<br>
<br>
_______________________________________________<br>
Zope maillist &nbsp;- &nbsp;<a href="mailto:Zope@zope.org">Zope@zope.org</a><br>
<a href="http://mail.zope.org/mailman/listinfo/zope" target="_blank">http://mail.zope.org/mailman/listinfo/zope</a><br>
** &nbsp; No cross posts or HTML encoding! &nbsp;**<br>
(Related lists -<br>
&nbsp;<a href="http://mail.zope.org/mailman/listinfo/zope-announce" target="_blank">http://mail.zope.org/mailman/listinfo/zope-announce</a><br>
&nbsp;<a href="http://mail.zope.org/mailman/listinfo/zope-dev" target="_blank">http://mail.zope.org/mailman/listinfo/zope-dev</a> )<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Mis Cosas<br><a href="http://blogs.sistes.net/Garito">http://blogs.sistes.net/Garito</a><br>Zope Smart Manager<br><a href="http://blogs.sistes.net/Garito/670">http://blogs.sistes.net/Garito/670</a><br>

</div>