[Zope] Populating a :list variable from the results of a ZSQL method

Geir Bækholt Geir Bækholt <geirh@funcom.com>
Fri, 10 Nov 2000 11:45:14 +0100


don't know about inside zope, but in plain python you could just do:

new_options = list(options)


perhaps an external method would cut it:

return list(inputstring)



--
Geir Bækholt
web-developer/designer
geirh@funcom.com
http://www.funcom.com

on Friday, November 10, 2000 Tony McDonald wrote :
TM> Hi all,
TM> Say I've got a form with this in it

TM> <select type="checkbox" name="options:list">
TM> <option value="1">number 1
TM> <option value="2">number 2
TM> <option value="3">number 3
TM> </select>

TM> When this is put into an SQL database, the field 'options' is this (string)

TM> ['1', '2', '3']  or ['2', '3'] etc.

TM> When I get the data back from the database, 'options' comes back as a 
TM> string, and <dtml-in options> ... </dtml-in> gives errors (basically, 
TM> it can't iterate over a string).

TM> I tried
TM> <dtml-call "REQUEST.set('new_options:list', options)">
TM> and then tried iterating over new_options, but the variable didn't exist...

TM> Has anyone got any solutions for this?
TM> TIA
TM> Tone
TM> ------
TM> Dr Tony McDonald,  Assistant Director, FMCC, http://www.fmcc.org.uk/
TM> The Medical School, Newcastle University Tel: +44 191 222 5116
TM> A Zope list for UK HE/FE  http://www.fmcc.org.uk/mailman/listinfo/zope

TM> _______________________________________________
TM> Zope maillist  -  Zope@zope.org
TM> http://lists.zope.org/mailman/listinfo/zope
TM> **   No cross posts or HTML encoding!  **
TM> (Related lists - 
TM>  http://lists.zope.org/mailman/listinfo/zope-announce
TM>  http://lists.zope.org/mailman/listinfo/zope-dev )