<div dir="ltr">Yeah, Mustaha!<br>Sometimes I think I'm a little stupid, jejejeje, I have in front of my nose but I don'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<version>/lib/python/zope/tales/tales.py and change the 592 and 593:<br><br>591 else:<br>592 type = "standard"<br>
593 expr = expression<br><br>to<br><br>else:<br> if expression.find('${') > -1:<br> type = "python"<br> expr = "path(path('string:%s'))" % expression<br> else: <br>
type = "standard"<br> 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's an acceptable change to the code for the job it does<br>
I don'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't misunderstand me, please<br><br><div class="gmail_quote">
2008/8/12 mustapha <span dir="ltr"><<a href="mailto:mustapha@headnet.dk">mustapha@headnet.dk</a>></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'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 "compile" method of the<br>
ExpressionEngine class (look in zope/tales/tales.py). It's there where<br>
the expressions are parsed.<br>
<br>
HTH<br>
<div class="Ih2E3d"><br>
Garito wrote:<br>
> Yes, it's ok but I can save n variable definitions with 4 lines of code<br>
> in 1 point<br>
> Seems quite interesting for me<br>
><br>
> Could someone point me were the page template decides if the expression<br>
> is a standard, string, python, etc one, please? ;)<br>
><br>
> 2008/8/11 Philipp von Weitershausen<br>
> <<a href="mailto:philipp@weitershausen.de">philipp@weitershausen.de</a><br>
</div>> <mailto:<a href="mailto:philipp@weitershausen.de">philipp@weitershausen.de</a>>><br>
<div class="Ih2E3d">><br>
> Garito wrote:<br>
> > Considere this case:<br>
> ><br>
> > I have the sking value in the variable at args/Yanged/Skin<br>
> ><br>
> > How can I do the equivalent to<br>
> ><br>
> ><br>
> args/Yanged/raiz/Skins/${args/Yanged/Skin}/arbolYanged.css/absolute_url<br>
> ><br>
> > ?<br>
> ><br>
> > In the python way it will be:<br>
> ><br>
> > path(path('string:' +<br>
> ><br>
> 'args/Yanged/raiz/Skins/${args/Yanged/Skin}/arbolYanged.css/absolute_url'))<br>
> ><br>
> > That's returns the expected value but I can't see how to do with your<br>
> > propossed way<br>
><br>
><br>
> <a tal:define="skin args/Yanged/Skin;<br>
> file args/Yanged/raiz/Skins/?skin/arbolYanged.css"<br>
> tal:attributes="href file/absolute_url"><br>
><br>
> _______________________________________________<br>
> Zope maillist - <a href="mailto:Zope@zope.org">Zope@zope.org</a><br>
</div>> <mailto:<a href="mailto:Zope@zope.org">Zope@zope.org</a>><br>
<div class="Ih2E3d">> <a href="http://mail.zope.org/mailman/listinfo/zope" target="_blank">http://mail.zope.org/mailman/listinfo/zope</a><br>
> ** No cross posts or HTML encoding! **<br>
> (Related lists -<br>
> <a href="http://mail.zope.org/mailman/listinfo/zope-announce" target="_blank">http://mail.zope.org/mailman/listinfo/zope-announce</a><br>
> <a href="http://mail.zope.org/mailman/listinfo/zope-dev" target="_blank">http://mail.zope.org/mailman/listinfo/zope-dev</a> )<br>
><br>
><br>
><br>
><br>
> --<br>
> Mis Cosas<br>
> <a href="http://blogs.sistes.net/Garito" target="_blank">http://blogs.sistes.net/Garito</a><br>
> Zope Smart Manager<br>
> <a href="http://blogs.sistes.net/Garito/670" target="_blank">http://blogs.sistes.net/Garito/670</a><br>
><br>
><br>
</div>> ------------------------------------------------------------------------<br>
<div><div></div><div class="Wj3C7c">><br>
> _______________________________________________<br>
> Zope maillist - <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>
> ** No cross posts or HTML encoding! **<br>
> (Related lists -<br>
> <a href="http://mail.zope.org/mailman/listinfo/zope-announce" target="_blank">http://mail.zope.org/mailman/listinfo/zope-announce</a><br>
> <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 - <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>
** No cross posts or HTML encoding! **<br>
(Related lists -<br>
<a href="http://mail.zope.org/mailman/listinfo/zope-announce" target="_blank">http://mail.zope.org/mailman/listinfo/zope-announce</a><br>
<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>