[Zope] dtml-in iteration over a string.split

Kapil V. Thangavelu k_vertigo@hotmail.com
Tue, 14 Mar 2000 11:24:56 -0500


This is untested but it should do the trick:)

<dtml-if "_.int(sequence-size) > 1">

as to why this doesn't work 

> <dtml-if "_['sequence-size'] > 1">
>Error, exceptions.KeyError: sequence-size 

i'm on shaky ground but here i think that your trying to lookup
sequence-size in the namespace variable but the batch process variables
aren't really defined in the global namespace. 

Daniel.Weber@sematech.org wrote:
> 
> > -----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....
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )