Opened 18 years ago
Closed 18 years ago
#4080 closed (duplicate)
newforms.widgets.RadioWidget should set attributes on the ul tag it renders
Reported by: | Iwan Vosloo | Owned by: | Adrian Holovaty |
---|---|---|---|
Component: | Forms | Version: | dev |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | yes | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
It seems that RadioWidget
does not render its HTML attributes passed in via attrs.
This is django.newforms.widgets.RadioWidget
in the svn branch http://code.djangoproject.com/svn/django/trunk (revision 5023).
So, if you have a form:
class AForm(django.newforms.Form): widget = django.newforms.widgets.RadioSelect(attrs={'class':'radioselect'}) field = django.newforms.fields.ChoiceField(choices=[('one', 'One'),('two', 'Two')], widget=widget)
then you would expect calling as_p on it (for example) to include a
class="radioselect" on, say, the ul that is generated. This does not
happen, neither does the ul have an id.
Attachments (1)
Change History (4)
by , 18 years ago
Attachment: | patch.diff added |
---|
comment:2 by , 18 years ago
Resolution: | duplicate |
---|---|
Status: | closed → reopened |
Summary: | newforms.widgets.RadioWidget does not render its attrs → newforms.widgets.RadioWidget should set attributes on the ul tag it renders |
Triage Stage: | Unreviewed → Accepted |
I am re-opening this for the request of adding attributes to the <ul>, which wasn't covered in #3870.
comment:3 by , 18 years ago
Resolution: | → duplicate |
---|---|
Status: | reopened → closed |
#4117 supersedes this ticket. Let's focus effort there.
Possible patch