Django

Code

Ticket #4080 (closed: duplicate)

Opened 2 years ago

Last modified 2 years ago

newforms.widgets.RadioWidget should set attributes on the ul tag it renders

Reported by: Iwan Vosloo Assigned to: adrian
Milestone: Component: Forms
Version: SVN Keywords:
Cc: Triage Stage: Accepted
Has patch: 1 Needs documentation: 0
Needs tests: 1 Patch needs improvement: 0

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

patch.diff (1.1 kB) - added by Iwan Vosloo on 04/19/07 00:59:47.
Possible patch

Change History

04/19/07 00:59:47 changed by Iwan Vosloo

  • attachment patch.diff added.

Possible patch

04/19/07 23:36:53 changed by Gary Wilson <gary.wilson@gmail.com>

  • status changed from new to closed.
  • resolution set to duplicate.

duplicate of #3870.

04/25/07 12:03:35 changed by Gary Wilson <gary.wilson@gmail.com>

  • status changed from closed to reopened.
  • summary changed from newforms.widgets.RadioWidget does not render its attrs to newforms.widgets.RadioWidget should set attributes on the ul tag it renders.
  • resolution deleted.
  • stage changed from Unreviewed to Accepted.

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

05/15/07 13:12:43 changed by Gary Wilson <gary.wilson@gmail.com>

  • status changed from reopened to closed.
  • resolution set to duplicate.

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


Add/Change #4080 (newforms.widgets.RadioWidget should set attributes on the ul tag it renders)




Change Properties
Action