#23681: Document how to customize NullBooleanSelect choice names
-------------------------------+--------------------------------------
     Reporter:  benjaoming     |                    Owner:  benjaoming
         Type:  New feature    |                   Status:  assigned
    Component:  Documentation  |                  Version:  master
     Severity:  Normal         |               Resolution:
     Keywords:                 |             Triage Stage:  Accepted
    Has patch:  0              |      Needs documentation:  0
  Needs tests:  0              |  Patch needs improvement:  0
Easy pickings:  0              |                    UI/UX:  0
-------------------------------+--------------------------------------

Comment (by Giovanni Totaro - aka Vanni):

 Regarding original @benjaoming request

   Even more preferable, would be to place the choices kwarg in
 NullBooleanField, as that would match the options for ChoiceField.

 I just tested it with Django 2.0 and it seems to already work fine:


 {{{
 class MyModel(models.Model):
     na_yes_no = models.NullBooleanField(choices=((None, "I don't care"),
 (True, "'Yes!"), (False, "Ooh no!"))
 )
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/23681#comment:11>
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/068.bdf8e2aefb2e4eee42d129db12409bff%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to