Ticket #15497: extjs_checkboxes.diff

File extjs_checkboxes.diff, 887 bytes (added by Luc Saffre, 14 years ago)

Patch against rev. 14995

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

     
    504504
    505505    def to_python(self, value):
    506506        if value in (True, False):
    507             # if value is 1 or 0 than it's equal to True or False, but we want
     507            # if value is 1 or 0 then it's equal to True or False, but we want
    508508            # to return a true bool for semantic reasons.
    509509            return bool(value)
    510         if value in ('t', 'True', '1'):
     510        if value in ('t', 'True', '1', 'on'):
    511511            return True
    512         if value in ('f', 'False', '0'):
     512        if value in ('f', 'False', '0', 'off'):
    513513            return False
    514514        raise exceptions.ValidationError(self.error_messages['invalid'])
Back to Top