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)

patch.diff (1.1 KB ) - added by Iwan Vosloo 18 years ago.
Possible patch

Download all attachments as: .zip

Change History (4)

by Iwan Vosloo, 18 years ago

Attachment: patch.diff added

Possible patch

comment:1 by Gary Wilson <gary.wilson@…>, 18 years ago

Resolution: duplicate
Status: newclosed

duplicate of #3870.

comment:2 by Gary Wilson <gary.wilson@…>, 18 years ago

Resolution: duplicate
Status: closedreopened
Summary: newforms.widgets.RadioWidget does not render its attrsnewforms.widgets.RadioWidget should set attributes on the ul tag it renders
Triage Stage: UnreviewedAccepted

I am re-opening this for the request of adding attributes to the <ul>, which wasn't covered in #3870.

comment:3 by Gary Wilson <gary.wilson@…>, 18 years ago

Resolution: duplicate
Status: reopenedclosed

#4117 supersedes this ticket. Let's focus effort there.

Note: See TracTickets for help on using tickets.
Back to Top