The reason is that I am porting some zclass objects into a database.  This field contains answers to a dynamic option list.
 
I don't think it would be that much of a pain in the ass to parse it into a dict, but I was thinking that Zope had some functions that could already do this.
 
I am  using Zope 2.7.
 
 
Chris
 
----- Original Message -----
From: Chris Withers
To: Chris Bruce
Cc: zope@zope.org
Sent: Wednesday, March 24, 2004 5:49 AM
Subject: Re: [Zope] Marshalling Strings back to data type

Chris Bruce wrote:

> I am storing a STRING version of dictionary in db like:

WHY?!

> {'3_Professional Designation': ['Bookkeeper', 'QuickBooks Certified Pro
> Advisor'], '4_Products Supported': ['QuickBooks & QuickBooks Pro'],
> '1_QuickBooks Services': ['Software Installation', 'Software Support',
> 'Troubleshooting', 'Phone Consultations', 'Seminars', 'One to One
> Training', 'Payroll'], '2_Accounting Services': ['Bookkeeping ',
> 'Payroll'], '5_Platforms Supported': ['Windows']}

> Is there a way in Zope to type that back to a dict?

Not securely or without much pain and suffering.

(The pain and suffering was described somewhere in one of the ZOpe list
archives, and involved repurposing part of the python compiler package, which is
only possible in Zope 2.7, IIRC)

cheers,

Chris

--
Simplistix - Content Management, Zope & Python Consulting
            - http://www.simplistix.co.uk