[ZPT] problems with RepeatVariable
Lynn Walton
waltonl@franklin.edu
Thu, 25 Oct 2001 13:31:00 -0500
I have the following:
<span tal:define="mainMenuTree python:here.mainTemplates.buildSiteMap()"
tal:omit-tag="">
<span tal:repeat="menuItem mainMenuTree" tal:omit-tag="">
<a href="" tal:attributes="href menuItem/name">
<span tal:replace="menuItem/name"></span></a>
<span tal:replace="python: repeat['menuItem'].number">1</span>
<span tal:condition="python: not
repeat['menuItem'].end">| </span>
</span>
</span>
When I use python: repeat['menuItem'].number" I get
<method Iterator.number of Iterator instance at ecf6d4> printed out
instead of the number.
When I use python: repeat['menuItem'].index" I get the proper index.
When I use repeat/menuItem/number rather than a python: expression, it
works giving the numbers.
But I thought
"python: repeat['menuItem'].number" was supposed to be an allowable
syntax?
Likewise,
<span tal:condition="python: not repeat['menuItem'].end">
gives isn't working, because it seems to be returning <method
Iterator.end of Iterator instance at e937cc> instead of true or false.
Can someone advise me on what I'm missing. I'm trying to follow the doc
at
http://www.zope.org//Wikis/DevSite/Projects/ZPT/RepeatVariable
I'm using PageTemplates-1-4-1
TAL 1.4.1
ZTUtils 1.1.2
Thanks,
Lynn