mirror of
https://github.com/netbox-community/netbox.git
synced 2026-02-19 15:27:44 +01:00
* Clean up base modules * Clean up forms modules * Clean up templatetags modules * Replace custom simplify_decimal filter with floatformat * Misc cleanup * Merge ReturnURLForm into ConfirmationForm * Clean up import statements for utilities.forms * Fix field class references in docs
49 lines
1.3 KiB
Python
49 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
|
|
from utilities.forms.fields import CommentField
|
|
from utilities.forms.widgets import BulkEditNullBooleanSelect
|
|
|
|
__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(
|
|
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',
|
|
)
|