Hi Josef<br><br><br><br><ul><br><li tal:define="query here/testquery" tal:repeat="result python:query(id='IT')"><br><span tal:replace="repeat/result">firstname goes here</span>
<br> </li><br></ul><br><br>gives the same<br><br>> AttributeError: Results instance has no __call__ method<br><br>As does<br> <br><span tal:replace="repeat/result/firstname">First Name</span>
<br><br>As does<br><br><span tal:replace="result/firstname">First Name</span><br><br>!<br><br>Thanks for your help. Not easy this ZPT!, even when you have read the documentation :-)<br><br><div><span class="gmail_quote">
On 11/2/07, <b class="gmail_sendername">Josef Meile</b> <<a href="mailto:jmeile@hotmail.com">jmeile@hotmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; margin-left: 0.80ex; border-left-color: #cccccc; border-left-width: 1px; border-left-style: solid; padding-left: 1ex">
Hi Michael<br><br>michael nt milne schrieb:<br>> yeah I have modified to this<br>><br>> <li tal:define = "query here/testquery"<br>> tal:repeat="result python:query(id='IT')">
<br>> <span tal:replace="python:repeat['result'].firstname">First<br>> Name</span><br>> </li><br>><br>> but get this as a result. Thanks for the reply.<br>><br>> Module
Products.PTProfiler.ProfilerPatch, line 32, in __patched_call__<br>> Module Products.PageTemplates.ZRPythonExpr, line 47, in __call__<br>> - __traceback_info__: query(id='IT')<br>> Module Python expression "query(id='IT')", line 1, in <expression>
<br>> AttributeError: Results instance has no __call__ method<br>I suspect that result isn't a dictionary. Why don't you try to print<br>result instead and see its type? Try this:<br><br><span tal:replace="repeat/result"></span>
<br><br>You could also try the other sintax for your zpt:<br><span tal:replace="repeat/result/firstname">First Name</span><br><br>Regards<br>Josef<br>_______________________________________________<br>
Zope maillist - <a href="mailto:Zope@zope.org">Zope@zope.org</a><br><a href="http://mail.zope.org/mailman/listinfo/zope">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">http://mail.zope.org/mailman/listinfo/zope-announce</a><br> <a href="http://mail.zope.org/mailman/listinfo/zope-dev">http://mail.zope.org/mailman/listinfo/zope-dev
</a> )<br></blockquote></div><br><br clear="all"><br>-- <br>michael