Python django.forms.widgets 模块,RadioSelect() 实例源码

我们从Python开源项目中,提取了以下4个代码示例,用于说明如何使用django.forms.widgets.RadioSelect()

项目:jiango    作者:yefei    | 项目源码 | 文件源码
def __init__(self, label_class='radio inline', *args, **kwargs):
        super(RadioSelect, self).__init__(*args, **kwargs)
        self.label_class = label_class
项目:issue-reporting    作者:6aika    | 项目源码 | 文件源码
def get_form(self, request, obj=None, **kwargs):
        form = super(ContentAdmin, self).get_form(request, obj, **kwargs)
        form.base_fields['identifier'].widget = RadioSelect(choices=CONTENT_IDENTIFIERS)
        return form
项目:issue-reporting    作者:6aika    | 项目源码 | 文件源码
def get_form(self, request, obj=None, **kwargs):
        form = super(ImageAdmin, self).get_form(request, obj, **kwargs)
        form.base_fields['identifier'].widget = RadioSelect(choices=IMAGE_IDENTIFIERS)
        return form
项目:old-web    作者:cualbondi    | 项目源码 | 文件源码
def is_radio(value):
    if not isinstance(value, BoundField):
        return False
    return isinstance(value.field.widget, RadioSelect)