#23580: forms.fields.NullBooleanField does not honor required=True
-------------------------------+--------------------------------------
     Reporter:  jdufresne      |                    Owner:  nobody
         Type:  Uncategorized  |                   Status:  new
    Component:  Forms          |                  Version:  master
     Severity:  Normal         |               Resolution:
     Keywords:                 |             Triage Stage:  Unreviewed
    Has patch:  1              |      Needs documentation:  0
  Needs tests:  0              |  Patch needs improvement:  0
Easy pickings:  0              |                    UI/UX:  0
-------------------------------+--------------------------------------

Comment (by jdufresne):

 > What would then be the difference between your proposal
 (forms.fields.NullBooleanField with required=True) and
 forms.fields.BooleanField with required=False?

 `forms.fields.BooleanField` does not allow for a "no answer". In my
 application the user must *explicitly* select Yes or No. Assuming No when
 no answer is provided is not an option.

 Just for some clarification, I'm rendering this field as a yes/no radio
 option:

 {{{
 This field is required.
 Do you agree with foo?
 [ ] Yes
 [ ] No
 }}}

 With my proposal above, the user would need to explicitly select No for
 the field to evaluate as `False`, if the field is required and and they do
 not select No, they will be warned.

--
Ticket URL: <https://code.djangoproject.com/ticket/23580#comment:4>
Django <https://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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.df8afcc2339ee9f7b109406ad171853c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to