#28712: Add ability to apply separate attributes to ChoiceWidget options
-------------------------------------+-------------------------------------
Reporter: Stephen Swatman | Owner: Stephen
| Swatman
Type: New feature | Status: assigned
Component: Forms | Version: master
Severity: Normal | Resolution:
Keywords: ChoiceWidget | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Stephen Swatman):
Replying to [comment:4 Tim Graham]:
> As for the case of styling, wouldn't it involve less markup to set a
class on the `<select>` and use a CSS selector (e.g. `select.super option
{...}`) for that? If anything, I'd think we'd want a way to specify a
different attribute value for each `<option>` value -- setting the same
key/value on every `<option>` doesn't seem like something to encourage.
You're right that the implementation in the PR was not very powerful. I
have now expanded the PR to allow for callable attribute values. This
would allow developers a lot of control over the attributes of each
option.
--
Ticket URL: <https://code.djangoproject.com/ticket/28712#comment:5>
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/069.22f6d944acdda03ae9f6997abe68cff5%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.