#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 ajendrex):

 Hello,

 I'm using [https://github.com/Yaco-Sistemas/django-inplaceedit/ django-
 inplaceedit] to show the value of a NullBooleanField. When the user edits
 the value, the form is built by django-inplaceedit. I would like to have a
 way to set the captions for the options to be other than "Unknown, Yes and
 No".

 I tried in the model definition, by writting

 {{{#!python
 calificada = models.NullBooleanField("Venta calificada", default=False,
 choices = {(None,"No Aplica"),(True,"Sí"),(False,"No")})
 }}}

 but then inplaceedit shows the values as text instead of the nice images
 that uses in the default case, which are being very useful for
 visualizing...

 Anyways, I can write some javascript to address my problem. Just wanted to
 point out an use case where one doesn't control the form creation.

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

Reply via email to