#15124: BooleanField should not use False as default (unless provided) ---------------------------+------------------------------------------------ Reporter: andrewbadr | Owner: nobody Status: new | Milestone: Component: Uncategorized | Version: 1.2 Keywords: | Stage: Unreviewed Has_patch: 0 | ---------------------------+------------------------------------------------ Steps to repro: 1) Make a Model with a BooleanField with no default 2) Instantiate that model with no initial value 3) The value of the BooleanField on that instance is False
Expected behavior: 3) The value of the BooleanField on that instance is None Guessing a value for the field is wrong. Attempting to save a model with a non-null field without providing a value for that field should be an error. (Postgres of course throws an error if you try to insert a row with no value for a required bool field.) It's ok for CharFields with blank=True to default to the empty string, because that's semantically the lack of a value for the field. However, True and False are equals; False is not the lack of a value. Note the existence of the opposite ticket, #2855, which was wontfix'd then apparently silently "fixed" at some point. -- Ticket URL: <http://code.djangoproject.com/ticket/15124> Django <http://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.