Skip to content

Commit

Permalink
Closes #14326: Move form mixins (#14327)
Browse files Browse the repository at this point in the history
* Move form mixins from extras app to netbox app

* Remove obsolete extras/admin.py
  • Loading branch information
jeremystretch authored Nov 22, 2023
1 parent a73ba00 commit 18422e1
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 13 deletions.
2 changes: 1 addition & 1 deletion netbox/core/forms/filtersets.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

from core.choices import *
from core.models import *
from extras.forms.mixins import SavedFiltersMixin
from netbox.forms import NetBoxModelFilterSetForm
from netbox.forms.mixins import SavedFiltersMixin
from netbox.utils import get_data_backend_choices
from utilities.forms import BOOLEAN_WITH_BLANK_CHOICES, FilterForm
from utilities.forms.fields import ContentTypeChoiceField, DynamicModelMultipleChoiceField
Expand Down
4 changes: 2 additions & 2 deletions netbox/dcim/forms/bulk_create.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from django import forms
from django.utils.translation import gettext_lazy as _

from dcim.models import *
from django.utils.translation import gettext_lazy as _
from extras.forms import CustomFieldsMixin
from extras.models import Tag
from netbox.forms.mixins import CustomFieldsMixin
from utilities.forms import BootstrapMixin, form_from_model
from utilities.forms.fields import DynamicModelMultipleChoiceField, ExpandableNameField
from .object_create import ComponentCreateForm
Expand Down
2 changes: 0 additions & 2 deletions netbox/extras/admin.py

This file was deleted.

1 change: 0 additions & 1 deletion netbox/extras/forms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@
from .bulk_edit import *
from .bulk_import import *
from .misc import *
from .mixins import *
from .scripts import *
2 changes: 1 addition & 1 deletion netbox/extras/forms/filtersets.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
from extras.choices import *
from extras.models import *
from netbox.forms.base import NetBoxModelFilterSetForm
from netbox.forms.mixins import SavedFiltersMixin
from tenancy.models import Tenant, TenantGroup
from utilities.forms import BOOLEAN_WITH_BLANK_CHOICES, FilterForm, add_blank_choice
from utilities.forms.fields import (
ContentTypeChoiceField, ContentTypeMultipleChoiceField, DynamicModelMultipleChoiceField, TagFilterField,
)
from utilities.forms.widgets import APISelectMultiple, DateTimePicker
from virtualization.models import Cluster, ClusterGroup, ClusterType
from .mixins import *

__all__ = (
'ConfigContextFilterForm',
Expand Down
2 changes: 1 addition & 1 deletion netbox/netbox/forms/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
from django.utils.translation import gettext_lazy as _

from extras.choices import *
from extras.forms.mixins import CustomFieldsMixin, SavedFiltersMixin, TagsMixin
from extras.models import CustomField, Tag
from utilities.forms import CSVModelForm
from utilities.forms.fields import CSVModelMultipleChoiceField, DynamicModelMultipleChoiceField
from utilities.forms.mixins import BootstrapMixin, CheckLastUpdatedMixin
from .mixins import CustomFieldsMixin, SavedFiltersMixin, TagsMixin

__all__ = (
'NetBoxModelForm',
Expand Down
File renamed without changes.
8 changes: 3 additions & 5 deletions netbox/users/forms/filtersets.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
from django import forms
from extras.forms.mixins import SavedFiltersMixin
from utilities.forms import FilterForm
from users.models import Token
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Group
from django.utils.translation import gettext_lazy as _

from netbox.forms import NetBoxModelFilterSetForm
from users.models import NetBoxGroup, NetBoxUser, ObjectPermission
from utilities.forms import BOOLEAN_WITH_BLANK_CHOICES
from netbox.forms.mixins import SavedFiltersMixin
from users.models import NetBoxGroup, NetBoxUser, ObjectPermission, Token
from utilities.forms import BOOLEAN_WITH_BLANK_CHOICES, FilterForm
from utilities.forms.fields import DynamicModelMultipleChoiceField
from utilities.forms.widgets import DateTimePicker

Expand Down

0 comments on commit 18422e1

Please sign in to comment.