I completed the pull request to restore the fallback for empty data, except 
for CheckboxInput. If you have any input, please speak up. 
https://github.com/django/django/pull/7068

On Wednesday, August 17, 2016 at 7:40:56 AM UTC-4, Tim Graham wrote:
>
> I think there's a misunderstanding. As the documentation says, 
> forms.BooleanField(required=False) is the common case because required=True 
> means the checkbox must be checked. It's only confusing in the context of a 
> non-browser request where empty POST data might have a different meaning.
>
> https://docs.djangoproject.com/en/stable/ref/forms/fields/#booleanfield
>
> On Wednesday, August 17, 2016 at 7:04:35 AM UTC-4, Michael Foster wrote:
>>
>> I believe Tom is right. The documentation is trivial but there is a need 
>> to raise an error or warning to the user when specifying required=False for 
>> boolean fields, as it is nonsensical.
>>
>> On Tuesday, August 16, 2016 at 12:52:06 AM UTC+1, Tom Christie wrote:
>>>
>>> It's not perfect but given that it's an inherent limitation of HTML 
>>> checkboxes, I don't think that documenting that limitation is that big a 
>>> deal.
>>>
>>> forms.BooleanField(required=False) feels like an odd combination to me 
>>> in any case. One way we could potentially help users would be to error in 
>>> that case unless an alternate widget is used (We could recommend select or 
>>> whatever it is we use for NullBooleanField in this case)
>>>
>>> We have the same issue in REST framework serializers FWIW. As with 
>>> Django<1.10 we treat omission as omission, not blank. And yes, we have to 
>>> special-case boolean omission.
>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/ecfac262-4320-4c45-9d94-04fb17be242e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to