[Zope-dev] DTML processing variable
Paul Erickson
erickson@kaivo.com
Fri, 10 Nov 2000 11:28:22 -0700
If this is your exact code, it looks like you should be using
"sequence-item", instead of "sequence_item".
You should also be able to do it without the external method like this:
(100% untested)
<dtml-in expr="_.string.split(acctUsersEmail)">
<dtml-var name="sequence-item">
</dtml-in>
"David W. Damon" wrote:
>
> Hey all,
>
> I'm having difficulty getting dtml-in to iterate over a list of strings
> returned from an external python method.
>
> Essentially, I have a string that is comprised of the contents of an HTML text
> area. I need to split the string into a list of words and iterate over this
> list.
>
> My external python method is this:
>
> def stringSplit( self, theString ):
> return string.split( theString )
>
> Heres the pertinent DTML.....
>
> -------------------
> <dtml-call expr="REQUEST.set( 'userList', stringSplit(acctUsersEmail))">
>
> <dtml-in userList>
> <dtml-var sequence_item>
> </dtml-in>
>
> <dtml-var REQUEST>
> -------------------
>
> If I comment out the dtml-in block, i have a userList variable in the REQUEST
> object that is something like: ['name1', 'name2', 'name3']
>
> Any ideas?
>
> -- dave
>
> _______________________________________________
> Zope-Dev maillist - Zope-Dev@zope.org
> http://lists.zope.org/mailman/listinfo/zope-dev
> ** No cross posts or HTML encoding! **
> (Related lists -
> http://lists.zope.org/mailman/listinfo/zope-announce
> http://lists.zope.org/mailman/listinfo/zope )
--
Paul Erickson | erickson@kaivo.com
Kaivo, Inc. | www.kaivo.com