[Zope] TAL Question: Iterating through a list

Thilo Rößler el-nino@gmx.li
Thu, 20 Feb 2003 08:17:09 +0100


> On a related note is there a way to call a ZSQL method directly through
> page templates?

Indeed, there is one.

<select name="MySelection" size="1">
        <option tal:repeat="Iteration container/MyZSQL" 
                        tal:content="Iteration/aName"
                        tal:attributes="value Iteration/aValue"></option>
</select>

This example fills a Drop-Down-Box with something taken from th ZSQL-Method 
"MyZSQL". The ZSQL-Method has to deliver the fields "aName" and "aValue".
The option-tag is repeated as often as there are results for myZSQL.

Hope this is what you have been looking for.

Thilo