[Zope] Re: Defining a dictionary in ZPT?

Radim Novotny novotny.radim at gmail.com
Thu Nov 1 16:15:17 EDT 2007

michael nt milne napsal(a):
> 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>&nbsp;
>   </li>

1) don't make spaces around = in HTML attributes:
         tal:define="query here/testquery"

2) Why do you use repeat['result'] ? Can you point us to documentation 
where did you read it ?
    tal:replace="result/firstname"  should work as expected or
    tal:replace="python:result['firstname']" in case of result is 
dictionary and you need to use python: for some reason.

3) what testquery returns ? I suppose it returns method, because you are 
calling this method wit parameter 'id', but I don't think you meant it 
in this way.

Radim Novotny

More information about the Zope mailing list