Ticket #8101: bool.diff

File bool.diff, 865 bytes (added by Alexander, 7 years ago)

patch

  • django/db/models/fields/__init__.py

     
    505505    def get_db_prep_value(self, value):
    506506        if value is None:
    507507            return None
    508         return bool(value)
     508        return to_python(value)
    509509
    510510    def get_manipulator_field_objs(self):
    511511        return [oldforms.CheckboxField]
     
    10131013        raise validators.ValidationError, _("This value must be either None, True or False.")
    10141014
    10151015    def get_db_prep_value(self, value):
    1016         if value is None:
    1017             return None
    1018         return bool(value)
     1016        return to_python(value)
    10191017
    10201018    def get_manipulator_field_objs(self):
    10211019        return [oldforms.NullBooleanField]
Back to Top