RE : RE : [CPS-devel] (no subject)

"Winterflood, Jonathan" <[email protected]>
Newsgroups gmane.comp.web.zope.cps.devel
Message-ID <2A5D32A4E4678A4D8A8AF34E3B0A785F26DDBA@CORPMAIL31.corp.capgemini.com>
Yep, I just did, and it works fine,make_query made me figure it out: it renamed my field name:list when the value was a list (finally remembered where it was i'd seen :list before)
 
Thanks all for your suggestions,
Thanks Anahide for the extra options
 
Regards,
Jonathan

________________________________

De: [email protected] de la part de jerome prudent
Date: mer. 07/03/2007 12:08
Cc: [email protected]
Objet : Re: RE : [CPS-devel] (no subject)


hi!
did you try boxname:list?

 
2007/3/7, Winterflood, Jonathan <[email protected]>: 

	Hi,
	 
	Thanks, that works just fine :)
	Any idea why the other one didn't?
	 
	Jonathan

________________________________

	De: [email protected] de la part de jerome prudent 
	Date: mer. 07/03/2007 11:30
	Cc: [email protected]
	Objet : Re: [CPS-devel] (no subject)
	
	 
	hello,
	did you try isinstance(val,str) ?
	
	 
	2007/3/7, Georges Racinet <[email protected]>: 
	


		On Mar 7, 2007, at 10:38 AM, Winterflood, Jonathan wrote:
		
		> 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?
		
		Aah, restricted code :-) You can't access all attributes, and some
		other magic occurs.
		Sometimes, it's not homogeneous to current Python. I don't know about
		lists, but I do know that you can't use 'set' (appeared in 
		python 2.4).
		
		
		> Is there a better way?
		
		Anyway, I think that if you explicit specify type your input  in the
		html <input name=l"ist:boxname"> then you should get a list no matter
		what.
		I'm not 100% sure, but you should give it a try.
		
		
		>
		> 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.
		>
		> _______________________________________________
		> cps-devel mailing list 
		> http://lists.nuxeo.com/mailman/listinfo/cps-devel
		
		---------
		Georges Racinet,   Nuxeo SAS 
		Open Source Enterprise Content Management (ECM) 
		Web: http://www.nuxeo.com/ and http://www.nuxeo.org/ - Tel: +33 1 40
		33 79 87
		
		
		
		_______________________________________________
		cps-devel mailing list
		http://lists.nuxeo.com/mailman/listinfo/cps-devel
		

	
	
	
	-- 
	J. Prudent 
	
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. 

	




-- 
J. Prudent 


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.

_______________________________________________
cps-devel mailing list
http://lists.nuxeo.com/mailman/listinfo/cps-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.