[Zope] Multiple selection and looping

Benoit DOMINIAK benoit.dominiak@makinacorpus.com
Fri, 13 Jul 2001 14:42:04 +0200


Sorry but it doesn't work :
Error Type: KeyError
Error Value: ['communication', 'distribution_channel', 'market_trends']

File C:\Program Files\zope\lib\python\DocumentTemplate\DT_Util.py, line 334, 
in eval
    (Object: _.getitem(connection))
    (Info: _)
  File <string>, line 0, in ?
KeyError: (see above)
-------------------------------------------------------------------

Any idea ?

Laurie said :

I think that either article_connection, or connection are not lists at the 
moment - you probably have to use
"_.getitem(<<<<either connection or article_connection>>>>>)" to evaluate 
the string into something that in can iterate over.

hth,
Laurie

-----Original Message-----
From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of
Benoit DOMINIAK
Sent: Friday, July 13, 2001 5:07 AM
To: zope@zope.org
Subject: [Zope] Multiple selection and looping


Hi everybody,
I made a Zclass with a multiple selection property "connection" and I want
to create checkboxes wich must be checked if the value of the checkbox is
one of the value of "connection".

Here is my code (with a little help from my friend Laurie ;-) :

<dtml-in "article_connection">
      <input type=checkbox name=connection value="<dtml-var sequence-item>"
		<dtml-call expr="REQUEST.set('mylistitem',_['sequence-item'])">
		<dtml-in connection>
			<dtml-if expr="_['sequence-item'] == mylistitem">
				checked
			</dtml-if>>
		</dtml-in>
      <dtml-var sequence-item><br>
</dtml-in>

It sounded good BUT :
Error Type: InError
Error Value: Strings are not allowed as input to the in tag.

Can somebody help me ??
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.