#34034: Adding a class on ChoiceWidget subwidgets is excessively difficult
------------------------------+------------------------------------
Reporter: Claude Paroz | Owner: nobody
Type: New feature | Status: new
Component: Forms | Version: dev
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
------------------------------+------------------------------------
Changes (by Carlton Gibson):
* stage: Unreviewed => Accepted
Comment:
Hey Claude,
> Maybe adding `option_attrs`…
So I'm looking at this in `ChoiceWidget`:
{{{
def create_option(
self, name, value, label, selected, index, subindex=None,
attrs=None
):
...
option_attrs = (
self.build_attrs(self.attrs, attrs) if
self.option_inherits_attrs else {}
)
...
}}}
Do you think pulling that into a property (that could then be overridden)
would be sufficient? Maybe the `else` would pull from an `__init__` arg. …
🤔
(Implementation TBD)
Seems a reasonable suggestion anyhow. Thanks.
--
Ticket URL: <https://code.djangoproject.com/ticket/34034#comment:3>
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/01070183838836a4-456b667a-0a07-4a36-8f3d-a0480972e804-000000%40eu-central-1.amazonses.com.