[ZPT] repeat tag behaviour

Miles Waller miles@emotion.co.uk
Sat, 17 Mar 2001 02:20:20 -0000


hi

i am dead impressed by the zpt stuff.  however, just trying out the repeat
examples, and i can't seem to get access to the list of items that i am
iterating over.  for example:

        <ul>
          <li tal:repeat="type python:'digital', 'analog', 'organic'">
           <a href="dummy" tal:replace="type">selection</a>
          </li>
        </ul>

brings up an error:

Error Type: KeyError
Error Value: type

Traceback (innermost last):
  File C:\PROGRA~1\JAMKIT\lib\python\ZPublisher\Publish.py, line 222, in
publish_module
  File C:\PROGRA~1\JAMKIT\lib\python\ZPublisher\Publish.py, line 187, in
publish
  File C:\PROGRA~1\JAMKIT\lib\python\Zope\__init__.py, line 221, in
zpublisher_exception_hook
    (Object: Traversable)
  File C:\PROGRA~1\JAMKIT\lib\python\ZPublisher\Publish.py, line 171, in
publish
  File C:\PROGRA~1\JAMKIT\lib\python\ZPublisher\mapply.py, line 160, in
mapply
    (Object: loopedxml)
  File C:\PROGRA~1\JAMKIT\lib\python\ZPublisher\Publish.py, line 112, in
call_object
    (Object: loopedxml)
  File C:\PROGRA~1\JAMKIT\lib\python\Shared\DC\Scripts\Bindings.py, line
324, in __call__
    (Object: loopedxml)
  File C:\PROGRA~1\JAMKIT\lib\python\Shared\DC\Scripts\Bindings.py, line
353, in _bindAndExec
    (Object: loopedxml)
  File C:\Program
Files\Jamkit\lib\python\Products\PresentationTemplates\PresentationTemplate.
py, line 281, in _exec
    (Object: loopedxml)
    (Info: {'here': <Folder instance at 013004E8>, 'template':
<PresentationTemplate instance at 01325C08>, 'nothing': None, 'container':
<Folder instance at 013004E8>, 'keywords': {}, 'traverse_subpath': []})
  File C:\Program Files\Jamkit\lib\python\TAL\TALInterpreter.py, line 135,
in __call__
  File C:\Program Files\Jamkit\lib\python\TAL\TALInterpreter.py, line 160,
in interpret
  File C:\Program Files\Jamkit\lib\python\TAL\TALInterpreter.py, line 257,
in do_loop
  File C:\Program Files\Jamkit\lib\python\TAL\TALInterpreter.py, line 160,
in interpret
  File C:\Program Files\Jamkit\lib\python\TAL\TALInterpreter.py, line 224,
in do_insertText
  File C:\Program
Files\Jamkit\lib\python\Products\PresentationTemplates\TALES.py, line 174,
in evaluateText
  File C:\Program
Files\Jamkit\lib\python\Products\PresentationTemplates\TALES.py, line 166,
in evaluate
  File C:\Program
Files\Jamkit\lib\python\Products\PresentationTemplates\Expressions.py, line
152, in __call__
KeyError: (see above)

doing it without the replace tag makes it all works fine.