mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Relocate ImportFormatChoices
This commit is contained in:
@ -17,7 +17,7 @@ from dcim.constants import *
|
|||||||
from dcim.models import *
|
from dcim.models import *
|
||||||
from ipam.models import ASN, RIR, VLAN, VRF
|
from ipam.models import ASN, RIR, VLAN, VRF
|
||||||
from tenancy.models import Tenant
|
from tenancy.models import Tenant
|
||||||
from utilities.forms.choices import ImportFormatChoices
|
from utilities.choices import ImportFormatChoices
|
||||||
from utilities.testing import ViewTestCases, create_tags, create_test_device, post_data
|
from utilities.testing import ViewTestCases, create_tags, create_test_device, post_data
|
||||||
from wireless.models import WirelessLAN
|
from wireless.models import WirelessLAN
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ from django.test import override_settings
|
|||||||
|
|
||||||
from dcim.models import *
|
from dcim.models import *
|
||||||
from users.models import ObjectPermission
|
from users.models import ObjectPermission
|
||||||
from utilities.forms.choices import ImportFormatChoices
|
from utilities.choices import ImportFormatChoices
|
||||||
from utilities.testing import ModelViewTestCase, create_tags
|
from utilities.testing import ModelViewTestCase, create_tags
|
||||||
|
|
||||||
|
|
||||||
|
@ -16,10 +16,10 @@ from django_tables2.export import TableExport
|
|||||||
|
|
||||||
from extras.models import ExportTemplate
|
from extras.models import ExportTemplate
|
||||||
from extras.signals import clear_webhooks
|
from extras.signals import clear_webhooks
|
||||||
|
from utilities.choices import ImportFormatChoices
|
||||||
from utilities.error_handlers import handle_protectederror
|
from utilities.error_handlers import handle_protectederror
|
||||||
from utilities.exceptions import AbortRequest, AbortTransaction, PermissionsViolation
|
from utilities.exceptions import AbortRequest, AbortTransaction, PermissionsViolation
|
||||||
from utilities.forms import BulkRenameForm, ConfirmationForm, ImportForm, restrict_form_fields
|
from utilities.forms import BulkRenameForm, ConfirmationForm, ImportForm, restrict_form_fields
|
||||||
from utilities.forms.choices import ImportFormatChoices
|
|
||||||
from utilities.htmx import is_htmx
|
from utilities.htmx import is_htmx
|
||||||
from utilities.permissions import get_permission_for_model
|
from utilities.permissions import get_permission_for_model
|
||||||
from utilities.views import GetReturnURLMixin
|
from utilities.views import GetReturnURLMixin
|
||||||
|
@ -197,3 +197,19 @@ class ButtonColorChoices(ChoiceSet):
|
|||||||
(BLACK, 'Black'),
|
(BLACK, 'Black'),
|
||||||
(WHITE, 'White'),
|
(WHITE, 'White'),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# Import Choices
|
||||||
|
#
|
||||||
|
|
||||||
|
class ImportFormatChoices(ChoiceSet):
|
||||||
|
CSV = 'csv'
|
||||||
|
JSON = 'json'
|
||||||
|
YAML = 'yaml'
|
||||||
|
|
||||||
|
CHOICES = [
|
||||||
|
(CSV, 'CSV'),
|
||||||
|
(JSON, 'JSON'),
|
||||||
|
(YAML, 'YAML'),
|
||||||
|
]
|
||||||
|
@ -1,17 +0,0 @@
|
|||||||
from utilities.choices import ChoiceSet
|
|
||||||
|
|
||||||
|
|
||||||
#
|
|
||||||
# Import Choices
|
|
||||||
#
|
|
||||||
|
|
||||||
class ImportFormatChoices(ChoiceSet):
|
|
||||||
CSV = 'csv'
|
|
||||||
JSON = 'json'
|
|
||||||
YAML = 'yaml'
|
|
||||||
|
|
||||||
CHOICES = [
|
|
||||||
(CSV, 'CSV'),
|
|
||||||
(JSON, 'JSON'),
|
|
||||||
(YAML, 'YAML'),
|
|
||||||
]
|
|
@ -7,8 +7,8 @@ import yaml
|
|||||||
from django import forms
|
from django import forms
|
||||||
from django.utils.translation import gettext as _
|
from django.utils.translation import gettext as _
|
||||||
|
|
||||||
|
from utilities.choices import ImportFormatChoices
|
||||||
from utilities.forms.utils import parse_csv
|
from utilities.forms.utils import parse_csv
|
||||||
from .choices import ImportFormatChoices
|
|
||||||
from .widgets import APISelect, APISelectMultiple, ClearableFileInput, StaticSelect
|
from .widgets import APISelect, APISelectMultiple, ClearableFileInput, StaticSelect
|
||||||
|
|
||||||
__all__ = (
|
__all__ = (
|
||||||
|
@ -9,7 +9,7 @@ from django.urls import reverse
|
|||||||
from extras.choices import ObjectChangeActionChoices
|
from extras.choices import ObjectChangeActionChoices
|
||||||
from extras.models import ObjectChange
|
from extras.models import ObjectChange
|
||||||
from users.models import ObjectPermission
|
from users.models import ObjectPermission
|
||||||
from utilities.forms.choices import ImportFormatChoices
|
from utilities.choices import ImportFormatChoices
|
||||||
from .base import ModelTestCase
|
from .base import ModelTestCase
|
||||||
from .utils import disable_warnings, post_data
|
from .utils import disable_warnings, post_data
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user