Closed GoogleCodeExporter closed 9 years ago
In newforms/fields.py, Field.clean raises ValidationError if a value is None.
This is
called by BooleanField.clean which calls its super. But a checkbox that is
unchecked
will make the value None, because it just omits it from the CGI parameters. So
this is
a bug in newforms.
Workaround: Make a BooleanField that does not call its super, like this:
class MyBooleanField(fields.Field):
widget = forms.CheckboxInput
def clean(self, value):
return bool(value)
Google, maybe this is fixed in later Django? Need to update Django or
back-patch.
Original comment by mimika...@gmail.com
on 18 Dec 2009 at 7:05
This is a Django bug, nothing in the helper code changes this behaviour as far
as I can tell.
Original comment by m...@google.com
on 8 Jun 2010 at 12:02
This is a problem with the app-engine service, and there is nothing a user can
do to fix it, so it is not correct to close it even if it comes from third
party software that you supply. The bug will still exist.
Original comment by mimika...@gmail.com
on 9 Jun 2010 at 10:06
If you can demonstrate a bug in the helper code, or supply a patch then it will
be welcomed.
Bugs in Django itself need to be fixed in Django.
Original comment by m...@google.com
on 10 Jun 2010 at 1:48
Original issue reported on code.google.com by
richard....@gmail.com
on 16 Dec 2009 at 8:49Attachments: