#29200 closed Bug (fixed)
RadioSelect does not render its label in MultiWidget
| Reported by: | Takayuki Hirai | Owned by: | Tim Graham |
|---|---|---|---|
| Component: | Forms | Version: | 1.11 |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Ready for checkin | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
The code:
from django import forms class MyWidget(forms.MultiWidget): def __init__(self): widgets = [ forms.RadioSelect( choices=[('aaa', 'bbb')] ) ] super(MyWidget, self).__init__( widgets=widgets, attrs={}, ) def decompress(self, v): return [] print(MyWidget().render('wname', None))
Actual output:
<ul>
<li><input type="radio" name="wname_0" value="aaa" />
</li>
</ul>
Expected output:
<ul>
<li><label><input type="radio" name="wname_0" value="aaa" />
bbb</label>
</li>
</ul>
It seems that this problem is caused by the following reasons:
- a template of
RadioSelectrequireswrap_labelcontext varialbe to render LABEL elements -
MultiWidget.get_context()dropswrap_label
Change History (8)
comment:1 by , 8 years ago
| Type: | Uncategorized → Bug |
|---|
comment:2 by , 8 years ago
| Triage Stage: | Unreviewed → Accepted |
|---|
comment:3 by , 8 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
comment:5 by , 8 years ago
| Triage Stage: | Accepted → Ready for checkin |
|---|
comment:8 by , 8 years ago
Yes, it doesn't qualify for a backport based on the supported versions policy
Note:
See TracTickets
for help on using tickets.
That's a regression in b52c73008a9d67e9ddbb841872dc15cdd3d6ee01.