[Zope] 'IN' Atribute within as a python script parameter

Florent Guillaume fg@nuxeo.com
13 Aug 2001 23:09:57 GMT


> You either have to use _['sequence-item'] ( I think your
> sequence-length is a typo) or <dtml-let si=sequence-item> <dtml-var
> "pythonScript(si)"></dtml-with>

However be careful, be *very* careful, when using _['sequence-item'] or
<dtml-let si=sequence-item>, because in the not so infrequent case where
sequence-item is an object that is callable, like, say, a DTML Document,
it will get called, thus rendered, and "si" will be a string and not an
object like you probably expected...


> But I dont think this is a good idea anyway. If you use pythonscripts,
> you dont need to do the loop in DTML. Just put it all in the
> pythonscript:

Agreed.


Florent Guillaume
Nuxeo