Ejemplo n.º 1
0
 class Meta:
     model = Tool
     fields = [
         'name',
         'niches',
         'description',
         'url',
         'pricing',
         'license_type',
         'license',
         'sectors',
         'languages_supported',
         'coop_made'
     ]
     labels = {
         'name': _('Name of tool'),
         'niches': _('What is this tool used for?'),
         'description': _('Description of tool'),
         'url': _('URL of tool website'),
         'license_type': _('How is this tool licensed?'),
         'sectors': _('Please choose a sector or sectors:'),
         'languages_supported': _('What languages does this tool support?'),
         'coop_made': _('Was this tool created by a co-op?')
     }
     help_texts = {
         'description': _('Max 270 characters.'),
         'sectors': _('Hold down the <kbd>ctrl</kbd> (Windows) or <kbd>command</kbd> (macOS) key to select multiple options.'),
         'languages_supported': _('Hold down the <kbd>ctrl</kbd> (Windows) or <kbd>command</kbd> (macOS) key to select multiple options.')
     }
     widgets = {
         'license_type': RadioSelect(attrs={'class': 'input-group radio', 'id': 'id_detailed_info-license_type'}),
         'license': Select(attrs={'id': 'id_detailed_info-license'}),
         'coop_made': RadioSelect(attrs={'class': 'input-group radio'})
     }
Ejemplo n.º 2
0
class SocialHistoryDataForm(ModelForm):
    smoker = TypedChoiceField(required=False,
                              empty_value=None,
                              choices=((True, _("Yes")), (False, _("No"))),
                              widget=RadioSelect(attrs={'id': 'id_smoker'}))
    ex_smoker = TypedChoiceField(required=False,
                                 empty_value=None,
                                 choices=((True, _("Yes")), (False, _("No"))),
                                 widget=RadioSelect)
    alcoholic = TypedChoiceField(
        required=False,
        empty_value=None,
        choices=((True, _("Yes")), (False, _("No"))),
        widget=RadioSelect(attrs={'id': 'id_alcoholic'}))

    class Meta:
        model = SocialHistoryData
        fields = [
            'smoker',
            'amount_cigarettes',
            'ex_smoker',
            'alcoholic',
            'alcohol_frequency',
            'alcohol_period',
            'drugs',
        ]

        widgets = dict(
            amount_cigarettes=Select(attrs={'class': 'form-control'}),
            alcohol_frequency=Select(attrs={'class': 'form-control'}),
            alcohol_period=Select(attrs={'class': 'form-control'}),
            drugs=RadioSelect(choices=(('ja_fez', _("Have already used")),
                                       ('faz', _('It is using')),
                                       ('nunca_fez', _('Have never used')))))
Ejemplo n.º 3
0
    class Meta:
        model = orderModel
        fields = ('number', 'haveKit', 'kitId', 'username', 'email', 'phone',
                  'province', 'city', 'county', 'address', 'paymentMethod',
                  'radioInvoice', 'invoice', 'message')

        widgets = {
            'number': NumberInput(attrs={'min': 1}),
            'haveKit': RadioSelect(),
            'paymentMethod': RadioSelect(),
            'radioInvoice': RadioSelect(),
        }

        def clean_kitId(self):  #allow empty for kitId
            return self.cleaned_data['kitId'] or None

        help_texts = {
            'username': '******',
        }

        error_messages = {
            'username': {
                'required': u'请输入联系人姓名',
                'invalid': u'请输入正确的联系人姓名'
            },
            'email': {
                'required': u'需要输入邮箱',
                'invalid': u'请提供有效的邮箱地址'
            },
        }
Ejemplo n.º 4
0
class ExportForm(Form):
    title = CharField(required=False,
                      widget=TextInput(attrs={
                          'class': 'form-control',
                          'disabled': ''
                      }))
    per_participant = BooleanField(initial=True, required=False)
    per_questionnaire = BooleanField(initial=True, required=False)
    per_eeg_raw_data = BooleanField(initial=True, required=False)
    per_eeg_nwb_data = BooleanField(initial=True, required=False)
    per_emg_data = BooleanField(initial=True, required=False)
    per_tms_data = BooleanField(initial=True, required=False)
    per_additional_data = BooleanField(initial=True, required=False)
    per_goalkeeper_game_data = BooleanField(initial=True, required=False)
    per_stimulus_data = BooleanField(initial=True, required=False)
    per_generic_data = BooleanField(initial=True, required=False)

    questionnaire_entrance_selected = []

    headings = ChoiceField(widget=RadioSelect(),
                           choices=HEADINGS_CHOICES,
                           required=False)
    responses = MultipleChoiceField(widget=CheckboxSelectMultiple(
        attrs={'data-error': _('Response must be selected')}),
                                    choices=RESPONSES_CHOICES,
                                    required=False)
    filesformat = ChoiceField(widget=RadioSelect(),
                              choices=FORMATS_CHOICES,
                              required=False)
Ejemplo n.º 5
0
 class MySQLNullBooleanForm(Form):
     nullbool0 = NullBooleanField(widget=RadioSelect(
         choices=NULLBOOL_CHOICES))
     nullbool1 = NullBooleanField(widget=RadioSelect(
         choices=NULLBOOL_CHOICES))
     nullbool2 = NullBooleanField(widget=RadioSelect(
         choices=NULLBOOL_CHOICES))
Ejemplo n.º 6
0
    def __init__(self, *args, **kwargs):
        super(PendingUserForm, self).__init__(*args, **kwargs)
        self.empty_permitted = False

        if "language" in self.fields:
            self.fields["language"].widget = RadioSelect(
                choices=PendingUser.LANGUAGE_CHOICES)
        if "membership_type" in self.fields:
            self.fields["membership_type"].widget = RadioSelect(
                choices=PendingUser.MEMBERSHIP_TYPE_CHOICES)
        if "is_ayy_member" in self.fields:
            self.fields["is_ayy_member"].widget = RadioSelect(
                choices=PendingUser.AYY_MEMBER_CHOICES)
        if "start_year" in self.fields:
            self.fields["start_year"] = TypedChoiceField(
                label=_(self.fields["start_year"].label),
                coerce=int,
                choices=year_choices,
                initial=timezone.now().year,
            )
        for visible in self.visible_fields():
            if visible.name not in [
                    "language",
                    "membership_type",
                    "is_ayy_member",
                    "has_accepted_policies",
            ]:
                visible.field.widget.attrs["class"] = "form-control"
Ejemplo n.º 7
0
 class Meta:
     model = ClusterRecsReviewQA
     fields = ["usefulness_qa", "choice_qa"]
     widgets = {
         'usefulness_qa': RadioSelect(),
         'choice_qa': RadioSelect(),
     }
Ejemplo n.º 8
0
    class Meta:
        model = InstitutionProfile
        # #todo -- convert this to a templated form with hand-controlled HTML
        # #fyi -- "twitter_image_displayed" is not shown (SPARC can change the value through the back-end)
        # why are we listing fields explicitly? because there are many #opendata fields which we don't want to display
        fields = list('''
            institution_website
            institution_twitter
            poc_name
            poc_job
            poc_email
            poc_twitter
            poc_url
            poc_visibility
            overview_raw
            campus_engagement
            library_engagement
            subject_engagement
            url_oer
            url_libguide
            taskforce
            staff
            staff_location
            catalog
            oer_included
            oerdegree_offered

            private_comments
            filled_in_by
            acknowledgments
        '''.split())

        widgets = {
            'poc_visibility':
            RadioSelect(choices=InstitutionProfile.POC_VISIBILITY_CHOICES),
            'campus_engagement':
            CheckboxSelectMultiple(
                choices=InstitutionProfile.CAMPUS_ENGAGEMENT_CHOICES),
            'library_engagement':
            CheckboxSelectMultiple(
                choices=InstitutionProfile.LIBRARY_ENGAGEMENT_CHOICES),
            'subject_engagement':
            CheckboxSelectMultiple(
                choices=InstitutionProfile.SUBJECT_ENGAGEMENT_CHOICES),
            'taskforce':
            RadioSelect(choices=InstitutionProfile.TASKFORCE_CHOICES),
            'staff':
            RadioSelect(choices=InstitutionProfile.STAFF_CHOICES),
            'staff_location':
            CheckboxSelectMultiple(
                choices=InstitutionProfile.STAFF_LOCATION_CHOICES),
            'catalog':
            CheckboxSelectMultiple(choices=InstitutionProfile.CATALOG_CHOICES),
            'oer_included':
            CheckboxSelectMultiple(
                choices=InstitutionProfile.OER_INCLUDED_CHOICES),
            'oerdegree_offered':
            RadioSelect(choices=InstitutionProfile.OERDEGREE_OFFERED_CHOICES),
        }
Ejemplo n.º 9
0
 class Meta:
     model = Interruption
     fields = ['cause_1', 'cause_2', 'cause_3']
     widgets = {
         'cause_1': RadioSelect(),
         'cause_2': RadioSelect(),
         'cause_3': RadioSelect(),
     }
Ejemplo n.º 10
0
 class Meta:
     model = UserProfile
     fields = ('smoker', 'talker', 'music')
     widgets = {
         'smoker': RadioSelect(),
         'talker': RadioSelect(),
         'music': RadioSelect(),
     }
Ejemplo n.º 11
0
    class Meta:
        model = Order
        fields = '__all__'

        widgets = {
            'category': RadioSelect(),
            'subcategory': RadioSelect(),
        }
Ejemplo n.º 12
0
Archivo: forms.py Proyecto: HNK7/helio
 class Meta:
     model = Event
     fields = ('tournament', 'category', 'title', 'start_at', 'division', 'format', 'draw', 'game')
     widgets = {'tournament': HiddenInput(),
                 'category': RadioSelect(renderer=HorizontalRadioRenderer),
                 'format': RadioSelect(renderer=HorizontalRadioRenderer),
                 'draw': RadioSelect(renderer=HorizontalRadioRenderer),
                 'game': RadioSelect(renderer=HorizontalRadioRenderer), }
Ejemplo n.º 13
0
 class Meta:
     model = Event
     exclude = ['reviewed', 'hidden', 'institution']
     widgets = {
         # #todo -- 'type': Question Type: Radio button with fill-in other
         'type': RadioSelect(choices=Event.TYPE_CHOICES),
         'scope': RadioSelect(choices=Event.SCOPE_CHOICES),
     }
Ejemplo n.º 14
0
 class Meta:
     model = RecordCategory
     fields = ('prop', 'record_type', )
     widgets = {'prop': RadioSelect(
         attrs={'onclick': 'this.form.submit()',
                'onChange': 'this.form.submit();',
                "class":"rb w-radio-input"}),
                'record_type': RadioSelect(attrs={
                    'onChange': 'this.form.submit();', "class":"rb w-radio-input"})}
Ejemplo n.º 15
0
 class Meta:
     model = UserRegistrationCourse
     exclude = ('user', 'course_id', 'language_code')
     widgets = {
         'origin': RadioSelect(attrs={'required': 'required'}),
         'homeless': RadioSelect(attrs={'required': 'required'}),
         'disabled_person': RadioSelect(attrs={'required': 'required'}),
         'social_disadvantage': RadioSelect(attrs={'required': 'required'})
     }
Ejemplo n.º 16
0
 class Meta:
     model = RecsReviewQA
     fields = ["quality_qa", "diversity_qa", "easiness_qa", "happiness_qa"]
     widgets = {
         'quality_qa': RadioSelect(),
         'diversity_qa': RadioSelect(),
         'easiness_qa': RadioSelect(),
         'happiness_qa': RadioSelect(),
     }
Ejemplo n.º 17
0
Archivo: forms.py Proyecto: ned2/tator
 class Meta:
     model = Annotation
     fields = '__all__'
     widgets = {
         'user': HiddenInput(),
         'query': HiddenInput(),
         'is_geo': RadioSelect(),
         'loc_type': RadioSelect(),
         'query_type': RadioSelect(),
     }
Ejemplo n.º 18
0
Archivo: forms.py Proyecto: leofn/nes
 class Meta:
     model = SocialDemographicData
     fields = ['natural_of', 'citizenship', 'profession', 'occupation', 'tv', 'dvd', 'radio', 'bath',
               'automobile', 'wash_machine', 'refrigerator', 'freezer', 'house_maid',
               'religion', 'payment', 'flesh_tone', 'patient_schooling', 'schooling', 'benefit_government',
               'social_class']
     widgets = {
         'natural_of': TextInput(attrs={'class': 'form-control'}),
         'citizenship': SelectBoxCountries(attrs={'data-flags': 'true'}),
         'patient_schooling': Select(attrs={'class': 'form-control'}),
         'schooling': Select(attrs={'class': 'form-control'}),
         'flesh_tone': Select(attrs={'class': 'form-control'}),
         'religion': Select(attrs={'class': 'form-control'}),
         'profession': TextInput(attrs={'class': 'form-control', 'placeholder': _('Type in profession')}),
         'occupation': TextInput(attrs={'class': 'form-control', 'placeholder': _('Inform occupation')}),
         'payment': Select(attrs={'class': 'form-control'}),
         'tv': RadioSelect(choices=((0, '0'), (1, '1'), (2, '2'), (3, '3'), (4, _('4 or +')))),
         'dvd': RadioSelect(choices=((0, '0'), (1, '1'), (2, '2'), (3, '3'), (4, _('4 or +')))),
         'radio': RadioSelect(choices=((0, '0'), (1, '1'), (2, '2'), (3, '3'), (4, _('4 or +')))),
         'bath': RadioSelect(choices=((0, '0'), (1, '1'), (2, '2'), (3, '3'), (4, _('4 or +')))),
         'automobile': RadioSelect(choices=((0, '0'), (1, '1'), (2, '2'), (3, '3'), (4, _('4 or +')))),
         'house_maid': RadioSelect(choices=((0, '0'), (1, '1'), (2, '2'), (3, '3'), (4, _('4 or +')))),
         'wash_machine': RadioSelect(choices=((0, '0'), (1, '1'), (2, '2'), (3, '3'), (4, _('4 or +')))),
         'refrigerator': RadioSelect(choices=((0, '0'), (1, '1'), (2, '2'), (3, '3'), (4, _('4 or +')))),
         'freezer': RadioSelect(choices=((0, '0'), (1, '1'), (2, '2'), (3, '3'), (4, _('4 or +')))),
         'social_class': TextInput(attrs={'class': 'form-control', 'readonly': ""})
     }
Ejemplo n.º 19
0
    class Meta:
        model = Team

        fields = ('manager', 'team_name', 'email', 'team_type', 'formation',
                  'total_cost')

        widgets = {
            'total_cost': HiddenInput(),
            'team_type': RadioSelect(),
            'formation': RadioSelect()
        }
Ejemplo n.º 20
0
 class Meta:
     model = Resource
     exclude = ['reviewed', 'hidden', 'institution']
     widgets = {
         'type': CheckboxSelectMultiple(choices=Resource.TYPE_CHOICES),
         'scope': RadioSelect(choices=Resource.SCOPE_CHOICES),
         # #todo -- license -- Question Type: Drop down menu with fill-in other
         'license': RadioSelect(choices=Resource.LICENSE_CHOICES),
         'audience':
         CheckboxSelectMultiple(choices=Resource.AUDIENCE_CHOICES),
     }
Ejemplo n.º 21
0
 class Meta:
     model = Instructor
     fields = ['hobbies', 'profile_picture', 'first_name', 'last_name', 'city', 'city_district', 'zip_code', 'description', 'is_private_instructor', 'work_in_student_home', 'work_in_instructor_home', 'maximum_students', 'price', 'price_model']
     widgets = {
         'first_name': TextInput(attrs={'class': 'form-control', 'placeholder': 'Förnamn'}),
         'last_name': TextInput(attrs={'class': 'form-control', 'placeholder': 'Efternamn'}),
         'hobbies': RadioSelect(),
         'city': TextInput(attrs={'class': 'form-control', 'placeholder': 'Stad... ex. Stockholm, Göteborg...'}),
         'city_district': TextInput(attrs={'class': 'form-control', 'placeholder': 'Kommun: ex. Sollentuna, Täby...'}),
         'zip_code': TextInput(attrs={'class': 'form-control', 'placeholder': 'Postnummer: ex. 123 45...'}),
         'description': Textarea(attrs={'class': 'form-control', 'placeholder': 'Kort biografi om dig själv: Hej...', 'rows':20}),
         'is_private_instructor': CheckboxInput(attrs={'class': 'bootstrap-switch', 'data-on-label': 'JA', 'data-off-label': 'NEJ', 'onchange': 'hide_show_instructor_fields()'}),
         'work_in_student_home': CheckboxInput(),
         'work_in_instructor_home': CheckboxInput(),
         'maximum_students': NumberInput(attrs={'class': 'form-control', 'placeholder': 'Antal personer jag klan lära ut till per tillfälle'}),
         'price': NumberInput(attrs={'class': 'form-control', 'placeholder': 'Pris per timme'}),
         'price_model': RadioSelect(),
     }
     error_messages = {
         'first_name': {
             'required': _('Du måste fylla i ditt förnamn'),
             'max_length': _('Texten du skrev in här var för långt'),
         },
         'last_name': {
             'required': _('Du måste fylla i ditt efternamn'),
             'max_length': _('Texten du skrev in här var för långt'),
         },
         'hobbies': {
             'required': _('Du måste välja en hobby'),
         },
         'city': {
             'required': _('Du måste fylla i din stad'),
             'max_length': _('Texten du skrev in här var för långt'),
         },
         'city_district': {
             'required': _('Du måste fylla i din kommun/stadsdel'),
             'max_length': _('Texten du skrev in här var för långt'),
         },
         'zip_code': {
             'required': _('Du måste fylla i ditt postnummer'),
             'max_length': _('Texten du skrev in här var för långt'),
         },
         'description': {
             'max_length': _('Texten du skrev in här var för långt, max 2500 tecken'),
         },
         'work_in_student_home': {
         },
         'work_in_instructor_home': {
         },
         'maximum_students': {
             'required': _('Du måste fylla i hur många hobbyister du kan ta per gång'),
             'max_length': _('Texten du skrev in här var för långt'),
         },
     }
Ejemplo n.º 22
0
 class Meta:
     model = Member
     exclude = ['position', 'expiration_date']
     widgets = {
         'callsign': TextInput(attrs={'size': 10}),
         'address': TextInput(attrs={'size': 40}),
         'state': TextInput(attrs={'size': 3}),
         'email_address': EmailInput(attrs={'size': 40}),
         'mailing_list': RadioSelect(choices=YES_NO_DROPDOWN),
         'wd_online': RadioSelect(choices=YES_NO_DROPDOWN),
         'arrl_member': RadioSelect(choices=YES_NO_DROPDOWN),
         'need_new_badge': RadioSelect(choices=YES_NO_DROPDOWN),
         'user': HiddenInput(),
     }
Ejemplo n.º 23
0
 class Meta:
     model = UserProfile
     fields = ('trainee', 'driver_license', 'car_owner', 'afpa_center', 'gender',)
     widgets = {
             'trainee': RadioSelect(attrs={'class': 'custom-control-input'}),
             'driver_license': RadioSelect(attrs={'class': 'custom-control-input'}),
             'car_owner': RadioSelect(attrs={'class': 'custom-control-input'}),
             'afpa_center': Select(attrs={'class': 'custom-select'}),
             'gender': Select(attrs={'class': 'custom-select'})
     }
     labels = { 
         'afpa_center': 'Centre AFPA',
         'gender': 'Genre',
     }
Ejemplo n.º 24
0
    class Meta:
        model = Policy
        exclude = ['reviewed', 'hidden', 'institution']

        widgets = {
            'policy_type':
            RadioSelect(choices=Policy.POLICY_TYPE_CHOICES),
            'scope':
            RadioSelect(choices=Policy.SCOPE_CHOICES),
            'policy_level':
            RadioSelect(choices=Policy.POLICY_LEVEL_CHOICES),
            'policy_definition':
            RadioSelect(choices=Policy.POLICY_DEFINITION_CHOICES),
        }
Ejemplo n.º 25
0
Archivo: forms.py Proyecto: jradd/ksdj
 class Meta:
     fields = (
         'name',
         'mac',
         'ip',
         'build_type',
         'os_release',
         'vlan',
         'notes',
     )
     model = models.Client
     widgets = {
         'build_type': RadioSelect(),
         'os_release': RadioSelect(),
     }
Ejemplo n.º 26
0
class ToolDetailedInfoForm(BaseModelForm):
    pricing = forms.ModelChoiceField(
        queryset=Pricing.objects.all(),
        empty_label=_('Not sure'),
        required=False,
        label=_('How much does this tool cost?'),
        widget=RadioSelect(attrs={'class': 'input-group radio'})
    )

    license = forms.ModelChoiceField(
        queryset=License.objects.all(),
        empty_label=_('Not sure'),
        required=False,
        label=_('Please choose a specific free / libre / open source license')
    )

    sector = forms.ChoiceField(
        choices=[('no', _('No')), ('yes', _('Yes'))],
        required=True,
        initial='no',
        label=_('Is this tool for a specific sector or sectors?'),
        widget=RadioSelect(attrs={'class': 'input-group radio'})
    )

    class Meta:
        model = Tool
        fields = [
            'pricing',
            'license_type',
            'license',
            'sectors',
            'languages_supported',
            'coop_made'
        ]
        labels = {
            'license_type': _('How is this tool licensed?'),
            'sectors': _('Please choose a sector or sectors:'),
            'languages_supported': _('What languages does this tool support?'),
            'coop_made': _('Was this tool created by a co-op?')
        }
        help_texts = {
            'sectors': _('Hold down the <kbd>ctrl</kbd> (Windows) or <kbd>command</kbd> (macOS) key to select multiple options.'),
            'languages_supported': _('Hold down the <kbd>ctrl</kbd> (Windows) or <kbd>command</kbd> (macOS) key to select multiple options.')
        }
        widgets = {
            'license_type': RadioSelect(attrs={'class': 'input-group radio'}),
            'coop_made': RadioSelect(attrs={'class': 'input-group radio'})
        }
Ejemplo n.º 27
0
    class Meta:
        model = Review
        fields = ('name', 'rating', 'review')
        widgets = {
            'name': forms.TextInput(
                attrs={
                    'type': 'text',
                    'class': 'form-control',
                    'id': 'name',
                    'aria-describedby': 'nameHelp',
                    'placeholder': 'Представтесь',
                    'name': 'name',
                    'data-cip-id': 'name'
                }
            ),
            'rating': RadioSelect(
                choices=[
                    (1, '1'), (2, '2'), (3, '3'), (4, '4'), (5, '5')
                ]
            ),
            'review': forms.Textarea(
                attrs={
                    'class': 'form-control',
                    'id': 'content',
                    'placeholder': 'Содержание',
                    'name': 'description'
                }
            ),

        }
Ejemplo n.º 28
0
    class Meta:
        model = Tarefa
        fields = ('descricao', 'tipoTarefa', 'nome')
        #exclude = ['utilizadorid']

        widgets= {
            'nome': TextInput(attrs={
                'class': 'form-control',
                'placeholder': 'Introduza o nome da tarefa',
                'required': 'required',
            }),
            'descricao': Textarea(attrs={
                'class': 'form-control',
                'placeholder': 'Introduza a descrição da tarefa',
                'required': 'required',
            }),
            'tipoTarefa': RadioSelect(attrs={
                'class': 'form-check-input',
                'required': 'required',
            },
                choices = (('Atividade', 'Atividade'), ('Transporte', 'Transporte'))
            )
        }

        labels= {
            'nome': _('Nome'),
            'descricao': _('Descrição'),
            'tipoTarefa': _('Tipo de Tarefa')
        }
Ejemplo n.º 29
0
 class SomeForm(Form):
     somechoice = ChoiceField(
         choices=(('\xc5', 'En tied\xe4'), ('\xf8', 'Mies'),
                  ('\xdf', 'Nainen')),
         widget=RadioSelect(),
         label='\xc5\xf8\xdf',
     )
Ejemplo n.º 30
0
class OrganizationBasicInfoUpdateForm(BaseModelForm):
    type = forms.ModelChoiceField(
        Type.objects.filter(name__in=[
            'Cooperative',
            'Potential cooperative',
            'Shared platform'
            # 'Supporting organization' TODO: Add flow for these.
        ]),
        empty_label=None,
        label=_('How would you describe your organization?'),
        required=True,
        initial=0,
        widget=RadioSelect(attrs={'class': 'input-group radio'})
    )

    languages = forms.ModelMultipleChoiceField(
        queryset=Language.objects.all(),
        required=True,
        label=_('Working languages'),
        help_text=_('Hold down the <kbd>ctrl</kbd> (Windows) or <kbd>command</kbd> (macOS) key to select multiple options.')
    )

    class Meta:
        model = Organization
        fields = [
            'type',
            'name',
            'languages',
            'url'
        ]
        labels = {
            'type': _('Organization type'),
            'url': _('Website address')
        }
        help_texts = {}
Ejemplo n.º 31
0
    def test_radiofieldrenderer(self):
        # RadioSelect uses a RadioFieldRenderer to render the individual radio inputs.
        # You can manipulate that object directly to customize the way the RadioSelect
        # is rendered.
        w = RadioSelect(choices=(('J', 'John'), ('P', 'Paul'), ('G', 'George'), ('R', 'Ringo')))
        r = w.get_renderer('beatle', 'J')
        inp_set1 = []
        inp_set2 = []
        inp_set3 = []
        inp_set4 = []

        for inp in r:
            inp_set1.append(str(inp))
            inp_set2.append('%s<br />' % inp)
            inp_set3.append('<p>%s %s</p>' % (inp.tag(), inp.choice_label))
            inp_set4.append(
                '%s %s %s %s %s' % (
                    inp.name,
                    inp.value,
                    inp.choice_value,
                    inp.choice_label,
                    inp.is_checked(),
                )
            )

        self.assertHTMLEqual('\n'.join(inp_set1), """<label><input checked type="radio" name="beatle" value="J" /> John</label>
<label><input type="radio" name="beatle" value="P" /> Paul</label>
<label><input type="radio" name="beatle" value="G" /> George</label>
<label><input type="radio" name="beatle" value="R" /> Ringo</label>""")
        self.assertHTMLEqual('\n'.join(inp_set2), """<label><input checked type="radio" name="beatle" value="J" /> John</label><br />
<label><input type="radio" name="beatle" value="P" /> Paul</label><br />
<label><input type="radio" name="beatle" value="G" /> George</label><br />
<label><input type="radio" name="beatle" value="R" /> Ringo</label><br />""")
        self.assertHTMLEqual('\n'.join(inp_set3), """<p><input checked type="radio" name="beatle" value="J" /> John</p>
<p><input type="radio" name="beatle" value="P" /> Paul</p>
<p><input type="radio" name="beatle" value="G" /> George</p>
<p><input type="radio" name="beatle" value="R" /> Ringo</p>""")
        self.assertHTMLEqual('\n'.join(inp_set4), """beatle J J John True
beatle J P Paul False
beatle J G George False
beatle J R Ringo False""")

        # A RadioFieldRenderer object also allows index access to individual RadioChoiceInput
        w = RadioSelect(choices=(('J', 'John'), ('P', 'Paul'), ('G', 'George'), ('R', 'Ringo')))
        r = w.get_renderer('beatle', 'J')
        self.assertHTMLEqual(str(r[1]), '<label><input type="radio" name="beatle" value="P" /> Paul</label>')
        self.assertHTMLEqual(
            str(r[0]),
            '<label><input checked type="radio" name="beatle" value="J" /> John</label>'
        )
        self.assertTrue(r[0].is_checked())
        self.assertFalse(r[1].is_checked())
        self.assertEqual((r[1].name, r[1].value, r[1].choice_value, r[1].choice_label), ('beatle', 'J', 'P', 'Paul'))

        # These individual widgets can accept extra attributes if manually rendered.
        self.assertHTMLEqual(
            r[1].render(attrs={'extra': 'value'}),
            '<label><input type="radio" extra="value" name="beatle" value="P" /> Paul</label>'
        )

        with self.assertRaises(IndexError):
            r[10]

        # You can create your own custom renderers for RadioSelect to use.
        class MyRenderer(RadioFieldRenderer):
            def render(self):
                return '<br />\n'.join(six.text_type(choice) for choice in self)
        w = RadioSelect(choices=(('J', 'John'), ('P', 'Paul'), ('G', 'George'), ('R', 'Ringo')), renderer=MyRenderer)
        self.assertHTMLEqual(
            w.render('beatle', 'G'),
            """<label><input type="radio" name="beatle" value="J" /> John</label><br />
<label><input type="radio" name="beatle" value="P" /> Paul</label><br />
<label><input checked type="radio" name="beatle" value="G" /> George</label><br />
<label><input type="radio" name="beatle" value="R" /> Ringo</label>"""
        )

        # Or you can use custom RadioSelect fields that use your custom renderer.
        class CustomRadioSelect(RadioSelect):
            renderer = MyRenderer
        w = CustomRadioSelect(choices=(('J', 'John'), ('P', 'Paul'), ('G', 'George'), ('R', 'Ringo')))
        self.assertHTMLEqual(
            w.render('beatle', 'G'),
            """<label><input type="radio" name="beatle" value="J" /> John</label><br />
<label><input type="radio" name="beatle" value="P" /> Paul</label><br />
<label><input checked type="radio" name="beatle" value="G" /> George</label><br />
<label><input type="radio" name="beatle" value="R" /> Ringo</label>"""
        )

        # You can customize rendering with outer_html/inner_html renderer variables (#22950)
        class MyRenderer(RadioFieldRenderer):
            # str is just to test some Python 2 issue with bytestrings
            outer_html = str('<div{id_attr}>{content}</div>')
            inner_html = '<p>{choice_value}{sub_widgets}</p>'
        w = RadioSelect(choices=(('J', 'John'), ('P', 'Paul'), ('G', 'George'), ('R', 'Ringo')), renderer=MyRenderer)
        output = w.render('beatle', 'J', attrs={'id': 'bar'})
        self.assertIsInstance(output, SafeData)
        self.assertHTMLEqual(
            output,
            """<div id="bar">
<p><label for="bar_0"><input checked type="radio" id="bar_0" value="J" name="beatle" /> John</label></p>
<p><label for="bar_1"><input type="radio" id="bar_1" value="P" name="beatle" /> Paul</label></p>
<p><label for="bar_2"><input type="radio" id="bar_2" value="G" name="beatle" /> George</label></p>
<p><label for="bar_3"><input type="radio" id="bar_3" value="R" name="beatle" /> Ringo</label></p>
</div>""")