mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-14 01:41:22 -06:00

* Remove StaticSelect, StaticSelectMultiple form widgets * Tag custom ChoiceField, MultipleChoiceField classes for removal in v3.6
48 lines
1.3 KiB
Python
48 lines
1.3 KiB
Python
from django import forms
|
|
from django.utils.translation import gettext as _
|
|
|
|
from core.choices import DataSourceTypeChoices
|
|
from core.models import *
|
|
from netbox.forms import NetBoxModelBulkEditForm
|
|
from utilities.forms import add_blank_choice, BulkEditNullBooleanSelect, CommentField
|
|
|
|
__all__ = (
|
|
'DataSourceBulkEditForm',
|
|
)
|
|
|
|
|
|
class DataSourceBulkEditForm(NetBoxModelBulkEditForm):
|
|
type = forms.ChoiceField(
|
|
choices=add_blank_choice(DataSourceTypeChoices),
|
|
required=False,
|
|
initial=''
|
|
)
|
|
enabled = forms.NullBooleanField(
|
|
required=False,
|
|
widget=BulkEditNullBooleanSelect(),
|
|
label=_('Enforce unique space')
|
|
)
|
|
description = forms.CharField(
|
|
max_length=200,
|
|
required=False
|
|
)
|
|
comments = CommentField(
|
|
widget=forms.Textarea,
|
|
label=_('Comments')
|
|
)
|
|
parameters = forms.JSONField(
|
|
required=False
|
|
)
|
|
ignore_rules = forms.CharField(
|
|
required=False,
|
|
widget=forms.Textarea()
|
|
)
|
|
|
|
model = DataSource
|
|
fieldsets = (
|
|
(None, ('type', 'enabled', 'description', 'comments', 'parameters', 'ignore_rules')),
|
|
)
|
|
nullable_fields = (
|
|
'description', 'description', 'parameters', 'comments', 'parameters', 'ignore_rules',
|
|
)
|