mirror of
https://github.com/netbox-community/netbox.git
synced 2026-01-12 23:02:17 -06:00
Some checks failed
CI / build (20.x, 3.12) (push) Has been cancelled
CI / build (20.x, 3.13) (push) Has been cancelled
CodeQL / Analyze (${{ matrix.language }}) (none, actions) (push) Has been cancelled
CodeQL / Analyze (${{ matrix.language }}) (none, javascript-typescript) (push) Has been cancelled
CodeQL / Analyze (${{ matrix.language }}) (none, python) (push) Has been cancelled
49 lines
1.4 KiB
Python
49 lines
1.4 KiB
Python
from django import forms
|
|
from django.utils.translation import gettext_lazy as _
|
|
|
|
from core.choices import JobIntervalChoices
|
|
from core.models import *
|
|
from netbox.forms import PrimaryModelBulkEditForm
|
|
from netbox.utils import get_data_backend_choices
|
|
from utilities.forms.rendering import FieldSet
|
|
from utilities.forms.widgets import BulkEditNullBooleanSelect
|
|
|
|
__all__ = (
|
|
'DataSourceBulkEditForm',
|
|
)
|
|
|
|
|
|
class DataSourceBulkEditForm(PrimaryModelBulkEditForm):
|
|
type = forms.ChoiceField(
|
|
label=_('Type'),
|
|
choices=get_data_backend_choices,
|
|
required=False
|
|
)
|
|
enabled = forms.NullBooleanField(
|
|
required=False,
|
|
widget=BulkEditNullBooleanSelect(),
|
|
label=_('Enabled')
|
|
)
|
|
sync_interval = forms.ChoiceField(
|
|
choices=JobIntervalChoices,
|
|
required=False,
|
|
label=_('Sync interval')
|
|
)
|
|
parameters = forms.JSONField(
|
|
label=_('Parameters'),
|
|
required=False
|
|
)
|
|
ignore_rules = forms.CharField(
|
|
label=_('Ignore rules'),
|
|
required=False,
|
|
widget=forms.Textarea()
|
|
)
|
|
|
|
model = DataSource
|
|
fieldsets = (
|
|
FieldSet('type', 'enabled', 'description', 'sync_interval', 'parameters', 'ignore_rules', 'comments'),
|
|
)
|
|
nullable_fields = (
|
|
'description', 'description', 'sync_interval', 'parameters', 'parameters', 'ignore_rules' 'comments',
|
|
)
|