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

2000-11-10 Thread Tony McDonald
Hi all, Say I've got a form with this in it select type="checkbox" name="options:list" option value="1"number 1 option value="2"number 2 option value="3"number 3 /select When this is put into an SQL database, the field 'options' is this (string) ['1', '2', '3'] or ['2', '3'] etc. When I get

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

2000-11-10 Thread Chris Withers
Tony McDonald wrote: When this is put into an SQL database, the field 'options' is this (string) ['1', '2', '3'] or ['2', '3'] etc. So you're storing the sequence as a string of the type shown above... ...ow ;-) Might be best to change your SQL Schema so your store one row per option...

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

2000-11-10 Thread Geir Bækholt
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 [EMAIL PROTECTED] http://www.funcom.com on Friday, November 10, 2000 Tony McDonald

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

2000-11-10 Thread Phil Harris
tone, How about (untested): where 'dboptions' is the string pulled from the DB, and 'options' is the list needed. dtml-call "REQUEST.set('options',[])" dtml-in "_.string.split(dboptions[1:-1],',')" dtml-call "options.append(_.int(_['sequence-item']))" /dtml-in This would then give you take