#29200: RadioSelect does not render its label in MultiWidget
               Reporter:  Takayuki Hirai  |          Owner:  nobody
                   Type:  Uncategorized   |         Status:  new
              Component:  Forms           |        Version:  1.11
               Severity:  Normal          |       Keywords:
           Triage Stage:  Unreviewed      |      Has patch:  0
    Needs documentation:  0               |    Needs tests:  0
Patch needs improvement:  0               |  Easy pickings:  0
                  UI/UX:  0               |
 The code:

 from django import forms

 class MyWidget(forms.MultiWidget):
     def __init__(self):
         widgets = [
                 choices=[('aaa', 'bbb')]
         super(MyWidget, self).__init__(

     def decompress(self, v):
         return []

 print(MyWidget().render('wname', None))

 Actual output:

     <li><input type="radio" name="wname_0" value="aaa" />


 Expected output:

     <li><label><input type="radio" name="wname_0" value="aaa" />


 It seems that this problem is caused by the following reasons:

 - a template of {{{RadioSelect}}} requires {{{wrap_label}}} context
 varialbe to render LABEL elements
 -  {{{MultiWidget.get_context()}}} drops {{{wrap_label}}}

Ticket URL: <https://code.djangoproject.com/ticket/29200>
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
For more options, visit https://groups.google.com/d/optout.

Reply via email to