Hi Wankyu Choi,
Hi all,
There must be a better way than:
<span tal:omit-tag="" tal:condition="python: this_object is not None"> <span tal:replace="python: this_object.getSomethingBig() " /> </span>
"tal:condition" is evaluated before "tal:replace" (see Zope Book, Appendix C, ZPT Reference), thus You should be able to save at least one <span> by saying: <span tal:condition="python: this_object is not None" tal:replace="python: this_object.getSomethingBig() " />
The following gives an attribute error if 'this_object' is None:
<span tal:replace="python: test(this_object is not None, this_object.getSomethingBig(), '')" />
test() seems to always evaluate both params no matter what. [...]
Yes, "test" is a "normal" function, and no magic syntax; arguments are always evaluated before the function "test" is evaluated. Cheers, Clemens