ok, thanks Duncan<br><br> <ul><br><li tal:define="query nocall:here/testquery" tal:repeat="result python:query(id='IT')"><br><span tal:replace="result/lastname">lastname goes here</span>
<br><br> </li><br></ul><br><br>works! I went down a blind alley with calling the database adapter due to confusion over the error message produced. Backs up my point about more friendly and usable error messages.
<br><br>Much appreciated!<br><br><div><span class="gmail_quote">On 11/2/07, <b class="gmail_sendername">Duncan Booth</b> <<a href="mailto:duncan.booth@suttoncourtenay.org.uk">duncan.booth@suttoncourtenay.org.uk</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">
"michael nt milne" <<a href="mailto:michael.milne@gmail.com">michael.milne@gmail.com</a>><br>wrote:<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>&nbsp;<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><br>That is because you already called the function.<br><br>The tal:define="query here/testquery" is (roughly) equivalent to:<br>tal:define="query python:
here.testquery()". If you want to use a path<br>expression which evaluates to something callable so that you have a shorter<br>name later when you call it then you explicitly say you don't want to call<br>it:<br>
<br> tal:define="query nocall:here/testquery"<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">
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