[CPS-devel] (no subject)

Winterflood, Jonathan jonathan.winterflood at capgemini.com
Wed Mar 7 10:38:17 CET 2007


Hi all,
 
I'm developping a product, and in one of my form processing scripts, I'm having to handle a number of checkboxes with the same name, say,'boxname'.
 
In the context.REQUEST.form dictionary, I have this:
with only one box ticked, dict['boxname'] is 'value_of_the_box'
with multiple boxes ticked, dict['boxname'] is a list of these values
 
I'm trying to change the single string to a one-element list, however, I can't test the type of the value...
Whenever I try to use the __class__ attribute, my script won't compile in Zope ( "__class__ is an invalid attribute" ...)
Therefore I can't test whether I have a list or a string.
I would use isinstance(val,list), but 'list' seems to behave as though it was 'list()' inside Zope, instead of giving me <type 'list'>
 
Both these work in a python console... I'm obviously missing something, but what?
Is there a better way?
 
Thanks a lot,
Jonathan


This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient,  you are not authorized to read, print, retain, copy, disseminate,  distribute, or use this message or any part thereof. If you receive this  message in error, please notify the sender immediately and delete all  copies of this message.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.nuxeo.com/pipermail/cps-devel/attachments/20070307/7bb75f9b/attachment.htm



This list archive provided by Nuxeo, the leaders of open source ECM. Check out the Nuxeo 5 open source, standards-based ECM project.