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

Casey Duncan cduncan@kaivo.com
Mon, 13 Aug 2001 14:41:32 -0600


Alexandre Aguiar wrote:
> 
> Im having some trouble trying to pass a atribute to a python script:
> 
> <dtml-in objectValues>
> <dtml-var "pythonScript(sequence-length)"> -- I dont know how I can make it
> understand the 'sequence-item'  as a parameter
> </dtml-in>
> 
> Thanks one more time for the help!
> 
> Alexandre Aguiar
> 

You do realize that the above would call the pythonScript once for each
item in the list right?

if that's not what you want try: <dtml-var
expr="pyScript(_.len(objectIds())">

if so then:

<dtml-in objectValues>
  <dtml-var "pythonScript(_['sequence-length'])">
</dtml-in>

any names with Python-significant characters (such as "." or "-") must
be escapes using _[] in expressions.

hth,
-- 
| Casey Duncan
| Kaivo, Inc.
| cduncan@kaivo.com
`------------------>