Python django.forms.fields 模块,ChoiceField() 实例源码

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

项目:callisto-core    作者:project-callisto    | 项目源码 | 文件源码
def dropdown(cls, choice):
        attrs = {
            'class': "extra-widget extra-widget-dropdown",
            'style': "display: none;",
        }
        return ChoiceField(
            required=False,
            choices=options_as_choices(choice),
            widget=Select(attrs=attrs),
        )
项目:django-wizard-builder    作者:project-callisto    | 项目源码 | 文件源码
def dropdown(cls, choice):
        attrs = {
            'class': "extra-widget extra-widget-dropdown",
            'style': "display: none;",
        }
        return ChoiceField(
            required=False,
            choices=options_as_choices(choice),
            widget=Select(attrs=attrs),
        )