[Zope] dtml-in iteration over a string.split
Daniel.Weber@SEMATECH.Org
Daniel.Weber@SEMATECH.Org
Tue, 14 Mar 2000 10:01:49 -0600
> -----Original Message-----
> From: Kevin Dangoor [mailto:kid@kendermedia.com]
> Sent: Tuesday, March 14, 2000 9:54 AM
> To: Daniel.Weber@SEMATECH.Org; zope@zope.org
> Subject: Re: [Zope] dtml-in iteration over a string.split
>
>
> ----- Original Message -----
> From: <Daniel.Weber@sematech.org>
> To: <zope@zope.org>
> Sent: Tuesday, March 14, 2000 8:48 AM
> Subject: RE: [Zope] dtml-in iteration over a string.split
>
>
> > I can't get this to work at all:
> > <dtml-if "sequence-size > 1">
> > zope complains about not being able to find 'sequence'. I
> had solved this
> issue
> > before with a let tag <dtml-let size=sequence-size>, but it
> seems very
> wasteful
> > and adds a lot of syntax overhead to the code. How can I access the
> sequence
> > variable in an expression?
>
> Since python interprets "sequence-size" to be sequence minus
> size, you need
> to do a namespace lookup to get at the value.
>
> <dtml-if "_['sequence-size'] > 1">
Error, exceptions.KeyError: sequence-size
Nice to know the trick, though. Now I just need to find where the sequence-size
is stored as....