Author: ianb
Date: 2005-12-12 23:02:45 +0000 (Mon, 12 Dec 2005)
New Revision: 1420

Modified:
   FormEncode/trunk/formencode/htmlfill.py
Log:
Fixed bug with checkboxes and passing in multiple values (similar to the 
problem with multiselects that was fixed earlier)

Modified: FormEncode/trunk/formencode/htmlfill.py
===================================================================
--- FormEncode/trunk/formencode/htmlfill.py     2005-12-12 16:15:10 UTC (rev 
1419)
+++ FormEncode/trunk/formencode/htmlfill.py     2005-12-12 23:02:45 UTC (rev 
1420)
@@ -328,11 +328,7 @@
             self.skip_next = True
             self.add_key(name)
         elif t == 'checkbox':
-            if (str(value) == self.get_attr(attrs, 'value')
-                or (self.get_attr(attrs, 'value') is None
-                    and value)
-                or (isinstance(value, (list, tuple))
-                    and self.get_attr(attrs, 'value') in map(str, value))):
+            if self.selected_multiple(value, self.get_attr(attrs, 'value')):
                 self.set_attr(attrs, 'checked', 'checked')
             else:
                 self.del_attr(attrs, 'checked')



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
FormEncode-CVS mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/formencode-cvs

Reply via email to