def radio(self, name, value=None, checked=False, label=None, **attrs): """ Return a radio button tag. """ name = self._get_name(name) checked = self.value(name) == value or checked return tags.radio(name, value, checked, label, **attrs)
def radio(self, name, value=None, checked=False, label=None, **attrs): """ Outputs radio input. """ checked = self.data.get(name) == value or checked attrs.update(self.validation_attrs(name)) return tags.radio(name, value, checked, label, **attrs)
def radio(self, name, value=None, checked=False, label=None, **attrs): """ Outputs radio input. """ try: checked = six.text_type(traverse_object_for_value(self.form.data, name)) == six.text_type(value) except (KeyError, AttributeError): pass return tags.radio(name, value, checked, label, **attrs)
def radio(self, name, value=None, checked=False, label=None, **attrs): """ Outputs radio input. """ try: checked = str(traverse_object_for_value(self.form.data, name)) == str(value) except (KeyError, AttributeError): pass return tags.radio(name, value, checked, label, **attrs)
def radio(self, name, value=None, checked=False, label=None, **attrs): """ Outputs radio input. """ checked = self.value(name) == value or checked return tags.radio(name, value, checked, label, **attrs)
def radio_button(name, *args, **options): _update_fa(options, name) return radio(name, *args, **options)