Hi Josef
<ul> <li tal:define="query here/testquery" tal:repeat="result python:query(id='IT')"> <span tal:replace="repeat/result">firstname goes here</span> </li> </ul> gives the same > AttributeError: Results instance has no __call__ method As does <span tal:replace="repeat/result/firstname">First Name</span> As does <span tal:replace="result/firstname">First Name</span> ! Thanks for your help. Not easy this ZPT!, even when you have read the documentation :-) On 11/2/07, Josef Meile <[EMAIL PROTECTED]> wrote: > > Hi Michael > > michael nt milne schrieb: > > yeah I have modified to this > > > > <li tal:define = "query here/testquery" > > tal:repeat="result python:query(id='IT')"> > > <span tal:replace="python:repeat['result'].firstname">First > > Name</span> > > </li> > > > > but get this as a result. Thanks for the reply. > > > > Module Products.PTProfiler.ProfilerPatch, line 32, in __patched_call__ > > Module Products.PageTemplates.ZRPythonExpr, line 47, in __call__ > > - __traceback_info__: query(id='IT') > > Module Python expression "query(id='IT')", line 1, in <expression> > > AttributeError: Results instance has no __call__ method > I suspect that result isn't a dictionary. Why don't you try to print > result instead and see its type? Try this: > > <span tal:replace="repeat/result"></span> > > You could also try the other sintax for your zpt: > <span tal:replace="repeat/result/firstname">First Name</span> > > Regards > Josef > _______________________________________________ > Zope maillist - [email protected] > http://mail.zope.org/mailman/listinfo/zope > ** No cross posts or HTML encoding! ** > (Related lists - > http://mail.zope.org/mailman/listinfo/zope-announce > http://mail.zope.org/mailman/listinfo/zope-dev ) > -- michael
_______________________________________________ Zope maillist - [email protected] http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
