Author: pjenvey
Date: 2008-11-21 15:00:51 -0700 (Fri, 21 Nov 2008)
New Revision: 3686
Modified:
FormEncode/trunk/formencode/htmlfill.py
Log:
default checkbox and radio values to an empty str so they're safe for
str_compare
fixes #2318954
thanks Brendan Doms
Modified: FormEncode/trunk/formencode/htmlfill.py
===================================================================
--- FormEncode/trunk/formencode/htmlfill.py 2008-11-21 21:53:53 UTC (rev
3685)
+++ FormEncode/trunk/formencode/htmlfill.py 2008-11-21 22:00:51 UTC (rev
3686)
@@ -363,7 +363,8 @@
selected = False
if not self.get_attr(attrs, 'value'):
selected = value
- elif self.selected_multiple(value, self.get_attr(attrs, 'value')):
+ elif self.selected_multiple(value,
+ self.get_attr(attrs, 'value', '')):
selected = True
if selected:
self.set_attr(attrs, 'checked', 'checked')
@@ -373,7 +374,7 @@
self.skip_next = True
self.add_key(name)
elif t == 'radio':
- if self.str_compare(value, self.get_attr(attrs, 'value')):
+ if self.str_compare(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 the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
FormEncode-CVS mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/formencode-cvs