#30998: Make it easier to use the model instance in ChoiceWidget.create_option()
----------------------------------------+------------------------
Reporter: Jon Dufresne | Owner: nobody
Type: New feature | Status: new
Component: Forms | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
----------------------------------------+------------------------
I often find myself needing to add extra attributes to subwdiget HTML
elements that depend on the model instance object. For example, HTML
`data-*` attributes.
Others have had similar needs and created their own solutions. For
example: <http://srcmvn.com/blog/2013/01/15/django-advanced-model-choice-
field/>.
As this isn't built-in, there have been some backward incompatible changes
on some releases: #27758.
This ticket proposes to make this feature built-in to remove the need for
third party applications to copy this boilerplate.
---
Right now, the `ModelChoiceField.iterator` and `ModelChoiceIterator aren't
documented. We could take this opportunity to do so if desired.
--
Ticket URL: <https://code.djangoproject.com/ticket/30998>
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 view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/052.fc4317b12809ec7975a58ef5f022c030%40djangoproject.com.