#14671: Allow overriding of ModelChoiceField.choices
-------------------------------+------------------------------------
     Reporter:  simon29        |                    Owner:  tbeadle
         Type:  Bug            |                   Status:  closed
    Component:  Forms          |                  Version:  master
     Severity:  Normal         |               Resolution:  wontfix
     Keywords:  sprintdec2010  |             Triage Stage:  Accepted
    Has patch:  1              |      Needs documentation:  1
  Needs tests:  1              |  Patch needs improvement:  1
Easy pickings:  0              |                    UI/UX:  0
-------------------------------+------------------------------------
Changes (by tbeadle):

 * status:  assigned => closed
 * resolution:   => wontfix


Comment:

 I can't think of a use case where it makes sense to add abitrary choices
 to the ones available for a ModelChoiceField via its queryset.  See
 http://stackoverflow.com/questions/5281195/forms-modelchoicefield-
 queryset-extra-choice-fields-django-forms for a way to use a normal
 ChoiceField to accomplish this.

 If the desire is to change the appearance of the choices when they are
 rendered, there is the `ModelChoiceField.label_from_instance` method that
 can be overridden.

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

Reply via email to