Ticket #5471: newforms_fields_py.patch

File newforms_fields_py.patch, 526 bytes (added by Paul Lanier <planier@…>, 17 years ago)

Patch for newforms/fields.py

  • django/newforms/fields.py

     
    435435    def clean(self, value):
    436436        "Returns a Python boolean object."
    437437        super(BooleanField, self).clean(value)
     438        # Check for '0' which is what as_hidden will give us for False
     439        if value == '0':
     440            return False
    438441        return bool(value)
    439442
    440443class NullBooleanField(BooleanField):
Back to Top