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

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

项目:netbox    作者:digitalocean    | 项目源码 | 文件源码
def get_form(self):
        """
        Provide a standard bulk delete form if none has been specified for the view
        """

        class BulkDeleteForm(ConfirmationForm):
            pk = ModelMultipleChoiceField(queryset=self.cls.objects.all(), widget=MultipleHiddenInput)

        if self.form:
            return self.form
        return BulkDeleteForm


#
# Device/VirtualMachine components
#
项目:django-livesettings3    作者:kunaldeo    | 项目源码 | 文件源码
def choice_field(self, **kwargs):
        if self.hidden:
            kwargs['widget'] = forms.MultipleHiddenInput()
        return forms.ChoiceField(choices=self.choices, **kwargs)
项目:django-livesettings3    作者:kunaldeo    | 项目源码 | 文件源码
def make_field(self, **kwargs):
        if self.choices:
            if self.hidden:
                kwargs['widget'] = forms.MultipleHiddenInput()
            field = self.choice_field(**kwargs)
        else:
            if self.hidden:
                kwargs['widget'] = forms.HiddenInput()
            field = self.field(**kwargs)

        field.group = self.group
        field.default_text = self.default_text
        return field
项目:nav    作者:UNINETT    | 项目源码 | 文件源码
def get_context_data_edit(self, context):
        context = super(RoomStatus, self).get_context_data_edit(context)
        context['form'].fields['extra_columns'].widget = forms.MultipleHiddenInput()
        return context
项目:edd    作者:JBEI    | 项目源码 | 文件源码
def get_merge_form(self, request):
        class MergeForm(forms.Form):
            # same name as admin site uses for checkboxes to select items for actions
            _selected_action = forms.CharField(widget=forms.MultipleHiddenInput)
            mtype = forms.ModelChoiceField(
                self.get_queryset(request),
                label=self.model._meta.verbose_name,
                widget=self.get_merge_autowidget(),
            )
        return MergeForm