#8663: Inconsistencies/Bug in ModelForm
---------------------------------------------+------------------------------
Reporter: lingrlongr | Owner: nobody
Status: new | Milestone: 1.0
Component: Forms | Version: SVN
Resolution: | Keywords: ModelForm forms
Stage: Design decision needed | Has_patch: 0
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
---------------------------------------------+------------------------------
Comment (by gkelly):
The Select widget choices must be passed to it, which is exactly what the
ModelForm does when it creates the Select widget, only it takes the
liberty of adding a default, or empty_label. The Select widget doesn't
know anything about the field it is representing, and thus cannot derive
the choices from it.
I believe if the user wants to declare a widget that they should have full
control, and the Select widget currently does that; it displays exactly
the choices that it's given and doesn't involve itself in adding a default
option. A ModelForm is more intelligent and has access to the necessary
data to derive whether or not a default choice should be added.
It may be "inconsistent", but I like the way it is. There's no reason to
override a widget if the automatic one does exactly what's desired.
--
Ticket URL: <http://code.djangoproject.com/ticket/8663#comment:2>
Django Code <http://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 post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---