RE: [Zope] string to list
17 Sep
2002
17 Sep
'02
3:56 p.m.
[ Bryan C. Andregg ]
I have a list that is stored in a database. When I retrieve the list it's returned as a string. I.E., ['a', 'b'] is not iterable. Does anyone have a conventient way to turn the string back into a list or should I just do the store differently?
Look at my post form Sept. 3, and the related thread, titled Re: [Zope] lists, not strings in database This should be close enough to work with. If you really get a string "['a','b']", you can strip off the leading and trailing brackets and the quotes and proceed as in the thread. You could also convert to a list of strings using eval() in an external method, but that would be overkill, I think. Cheers, Tom P
8603
Age (days ago)
8603
Last active (days ago)
0 comments
1 participants
participants (1)
-
Passin,Thomas B. (Tom)