mirror of
https://github.com/netbox-community/netbox.git
synced 2026-01-23 03:58:45 -06:00
Add 'owner' field to bulk operation forms
This commit is contained in:
@@ -34,7 +34,7 @@ __all__ = (
|
|||||||
class ProviderFilterForm(ContactModelFilterForm, NetBoxModelFilterSetForm):
|
class ProviderFilterForm(ContactModelFilterForm, NetBoxModelFilterSetForm):
|
||||||
model = Provider
|
model = Provider
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('region_id', 'site_group_id', 'site_id', name=_('Location')),
|
FieldSet('region_id', 'site_group_id', 'site_id', name=_('Location')),
|
||||||
FieldSet('asn_id', name=_('ASN')),
|
FieldSet('asn_id', name=_('ASN')),
|
||||||
FieldSet('contact', 'contact_role', 'contact_group', name=_('Contacts')),
|
FieldSet('contact', 'contact_role', 'contact_group', name=_('Contacts')),
|
||||||
@@ -69,7 +69,7 @@ class ProviderFilterForm(ContactModelFilterForm, NetBoxModelFilterSetForm):
|
|||||||
class ProviderAccountFilterForm(ContactModelFilterForm, NetBoxModelFilterSetForm):
|
class ProviderAccountFilterForm(ContactModelFilterForm, NetBoxModelFilterSetForm):
|
||||||
model = ProviderAccount
|
model = ProviderAccount
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('provider_id', 'account', name=_('Attributes')),
|
FieldSet('provider_id', 'account', name=_('Attributes')),
|
||||||
FieldSet('contact', 'contact_role', 'contact_group', name=_('Contacts')),
|
FieldSet('contact', 'contact_role', 'contact_group', name=_('Contacts')),
|
||||||
)
|
)
|
||||||
@@ -88,7 +88,7 @@ class ProviderAccountFilterForm(ContactModelFilterForm, NetBoxModelFilterSetForm
|
|||||||
class ProviderNetworkFilterForm(NetBoxModelFilterSetForm):
|
class ProviderNetworkFilterForm(NetBoxModelFilterSetForm):
|
||||||
model = ProviderNetwork
|
model = ProviderNetwork
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('provider_id', 'service_id', name=_('Attributes')),
|
FieldSet('provider_id', 'service_id', name=_('Attributes')),
|
||||||
)
|
)
|
||||||
provider_id = DynamicModelMultipleChoiceField(
|
provider_id = DynamicModelMultipleChoiceField(
|
||||||
@@ -107,7 +107,7 @@ class ProviderNetworkFilterForm(NetBoxModelFilterSetForm):
|
|||||||
class CircuitTypeFilterForm(NetBoxModelFilterSetForm):
|
class CircuitTypeFilterForm(NetBoxModelFilterSetForm):
|
||||||
model = CircuitType
|
model = CircuitType
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('color', name=_('Attributes')),
|
FieldSet('color', name=_('Attributes')),
|
||||||
)
|
)
|
||||||
tag = TagFilterField(model)
|
tag = TagFilterField(model)
|
||||||
@@ -121,7 +121,7 @@ class CircuitTypeFilterForm(NetBoxModelFilterSetForm):
|
|||||||
class CircuitFilterForm(TenancyFilterForm, ContactModelFilterForm, NetBoxModelFilterSetForm):
|
class CircuitFilterForm(TenancyFilterForm, ContactModelFilterForm, NetBoxModelFilterSetForm):
|
||||||
model = Circuit
|
model = Circuit
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('provider_id', 'provider_account_id', 'provider_network_id', name=_('Provider')),
|
FieldSet('provider_id', 'provider_account_id', 'provider_network_id', name=_('Provider')),
|
||||||
FieldSet(
|
FieldSet(
|
||||||
'type_id', 'status', 'install_date', 'termination_date', 'commit_rate', 'distance', 'distance_unit',
|
'type_id', 'status', 'install_date', 'termination_date', 'commit_rate', 'distance', 'distance_unit',
|
||||||
@@ -274,7 +274,7 @@ class CircuitTerminationFilterForm(NetBoxModelFilterSetForm):
|
|||||||
class CircuitGroupFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
class CircuitGroupFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
||||||
model = CircuitGroup
|
model = CircuitGroup
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('tenant_group_id', 'tenant_id', name=_('Tenant')),
|
FieldSet('tenant_group_id', 'tenant_id', name=_('Tenant')),
|
||||||
)
|
)
|
||||||
tag = TagFilterField(model)
|
tag = TagFilterField(model)
|
||||||
@@ -312,7 +312,7 @@ class CircuitGroupAssignmentFilterForm(NetBoxModelFilterSetForm):
|
|||||||
class VirtualCircuitTypeFilterForm(NetBoxModelFilterSetForm):
|
class VirtualCircuitTypeFilterForm(NetBoxModelFilterSetForm):
|
||||||
model = VirtualCircuitType
|
model = VirtualCircuitType
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('color', name=_('Attributes')),
|
FieldSet('color', name=_('Attributes')),
|
||||||
)
|
)
|
||||||
tag = TagFilterField(model)
|
tag = TagFilterField(model)
|
||||||
@@ -326,7 +326,7 @@ class VirtualCircuitTypeFilterForm(NetBoxModelFilterSetForm):
|
|||||||
class VirtualCircuitFilterForm(TenancyFilterForm, ContactModelFilterForm, NetBoxModelFilterSetForm):
|
class VirtualCircuitFilterForm(TenancyFilterForm, ContactModelFilterForm, NetBoxModelFilterSetForm):
|
||||||
model = VirtualCircuit
|
model = VirtualCircuit
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('provider_id', 'provider_account_id', 'provider_network_id', name=_('Provider')),
|
FieldSet('provider_id', 'provider_account_id', 'provider_network_id', name=_('Provider')),
|
||||||
FieldSet('type_id', 'status', name=_('Attributes')),
|
FieldSet('type_id', 'status', name=_('Attributes')),
|
||||||
FieldSet('tenant_group_id', 'tenant_id', name=_('Tenant')),
|
FieldSet('tenant_group_id', 'tenant_id', name=_('Tenant')),
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ from netbox.utils import get_data_backend_choices
|
|||||||
from users.models import User
|
from users.models import User
|
||||||
from utilities.forms import BOOLEAN_WITH_BLANK_CHOICES, FilterForm, add_blank_choice
|
from utilities.forms import BOOLEAN_WITH_BLANK_CHOICES, FilterForm, add_blank_choice
|
||||||
from utilities.forms.fields import (
|
from utilities.forms.fields import (
|
||||||
ContentTypeChoiceField, ContentTypeMultipleChoiceField, DynamicModelMultipleChoiceField,
|
ContentTypeChoiceField, ContentTypeMultipleChoiceField, DynamicModelMultipleChoiceField, TagFilterField,
|
||||||
)
|
)
|
||||||
from utilities.forms.rendering import FieldSet
|
from utilities.forms.rendering import FieldSet
|
||||||
from utilities.forms.widgets import DateTimePicker
|
from utilities.forms.widgets import DateTimePicker
|
||||||
@@ -26,7 +26,7 @@ __all__ = (
|
|||||||
class DataSourceFilterForm(NetBoxModelFilterSetForm):
|
class DataSourceFilterForm(NetBoxModelFilterSetForm):
|
||||||
model = DataSource
|
model = DataSource
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('type', 'status', 'enabled', 'sync_interval', name=_('Data Source')),
|
FieldSet('type', 'status', 'enabled', 'sync_interval', name=_('Data Source')),
|
||||||
)
|
)
|
||||||
type = forms.MultipleChoiceField(
|
type = forms.MultipleChoiceField(
|
||||||
@@ -51,6 +51,7 @@ class DataSourceFilterForm(NetBoxModelFilterSetForm):
|
|||||||
choices=JobIntervalChoices,
|
choices=JobIntervalChoices,
|
||||||
required=False
|
required=False
|
||||||
)
|
)
|
||||||
|
tag = TagFilterField(model)
|
||||||
|
|
||||||
|
|
||||||
class DataFileFilterForm(NetBoxModelFilterSetForm):
|
class DataFileFilterForm(NetBoxModelFilterSetForm):
|
||||||
|
|||||||
@@ -142,7 +142,8 @@ class DeviceComponentFilterForm(NetBoxModelFilterSetForm):
|
|||||||
class RegionFilterForm(ContactModelFilterForm, NetBoxModelFilterSetForm):
|
class RegionFilterForm(ContactModelFilterForm, NetBoxModelFilterSetForm):
|
||||||
model = Region
|
model = Region
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag', 'parent_id'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
|
FieldSet('parent_id', name=_('Region')),
|
||||||
FieldSet('contact', 'contact_role', 'contact_group', name=_('Contacts'))
|
FieldSet('contact', 'contact_role', 'contact_group', name=_('Contacts'))
|
||||||
)
|
)
|
||||||
parent_id = DynamicModelMultipleChoiceField(
|
parent_id = DynamicModelMultipleChoiceField(
|
||||||
@@ -156,7 +157,8 @@ class RegionFilterForm(ContactModelFilterForm, NetBoxModelFilterSetForm):
|
|||||||
class SiteGroupFilterForm(ContactModelFilterForm, NetBoxModelFilterSetForm):
|
class SiteGroupFilterForm(ContactModelFilterForm, NetBoxModelFilterSetForm):
|
||||||
model = SiteGroup
|
model = SiteGroup
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag', 'parent_id'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
|
FieldSet('parent_id', name=_('Site Group')),
|
||||||
FieldSet('contact', 'contact_role', 'contact_group', name=_('Contacts'))
|
FieldSet('contact', 'contact_role', 'contact_group', name=_('Contacts'))
|
||||||
)
|
)
|
||||||
parent_id = DynamicModelMultipleChoiceField(
|
parent_id = DynamicModelMultipleChoiceField(
|
||||||
@@ -170,7 +172,7 @@ class SiteGroupFilterForm(ContactModelFilterForm, NetBoxModelFilterSetForm):
|
|||||||
class SiteFilterForm(TenancyFilterForm, ContactModelFilterForm, NetBoxModelFilterSetForm):
|
class SiteFilterForm(TenancyFilterForm, ContactModelFilterForm, NetBoxModelFilterSetForm):
|
||||||
model = Site
|
model = Site
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('status', 'region_id', 'group_id', 'asn_id', name=_('Attributes')),
|
FieldSet('status', 'region_id', 'group_id', 'asn_id', name=_('Attributes')),
|
||||||
FieldSet('tenant_group_id', 'tenant_id', name=_('Tenant')),
|
FieldSet('tenant_group_id', 'tenant_id', name=_('Tenant')),
|
||||||
FieldSet('contact', 'contact_role', 'contact_group', name=_('Contacts')),
|
FieldSet('contact', 'contact_role', 'contact_group', name=_('Contacts')),
|
||||||
@@ -202,7 +204,7 @@ class SiteFilterForm(TenancyFilterForm, ContactModelFilterForm, NetBoxModelFilte
|
|||||||
class LocationFilterForm(TenancyFilterForm, ContactModelFilterForm, NetBoxModelFilterSetForm):
|
class LocationFilterForm(TenancyFilterForm, ContactModelFilterForm, NetBoxModelFilterSetForm):
|
||||||
model = Location
|
model = Location
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('region_id', 'site_group_id', 'site_id', 'parent_id', 'status', 'facility', name=_('Attributes')),
|
FieldSet('region_id', 'site_group_id', 'site_id', 'parent_id', 'status', 'facility', name=_('Attributes')),
|
||||||
FieldSet('tenant_group_id', 'tenant_id', name=_('Tenant')),
|
FieldSet('tenant_group_id', 'tenant_id', name=_('Tenant')),
|
||||||
FieldSet('contact', 'contact_role', 'contact_group', name=_('Contacts')),
|
FieldSet('contact', 'contact_role', 'contact_group', name=_('Contacts')),
|
||||||
@@ -249,6 +251,9 @@ class LocationFilterForm(TenancyFilterForm, ContactModelFilterForm, NetBoxModelF
|
|||||||
|
|
||||||
class RackRoleFilterForm(NetBoxModelFilterSetForm):
|
class RackRoleFilterForm(NetBoxModelFilterSetForm):
|
||||||
model = RackRole
|
model = RackRole
|
||||||
|
fieldsets = (
|
||||||
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
|
)
|
||||||
tag = TagFilterField(model)
|
tag = TagFilterField(model)
|
||||||
|
|
||||||
|
|
||||||
@@ -303,7 +308,7 @@ class RackBaseFilterForm(NetBoxModelFilterSetForm):
|
|||||||
class RackTypeFilterForm(RackBaseFilterForm):
|
class RackTypeFilterForm(RackBaseFilterForm):
|
||||||
model = RackType
|
model = RackType
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('manufacturer_id', 'form_factor', 'width', 'u_height', name=_('Rack Type')),
|
FieldSet('manufacturer_id', 'form_factor', 'width', 'u_height', name=_('Rack Type')),
|
||||||
FieldSet('starting_unit', 'desc_units', name=_('Numbering')),
|
FieldSet('starting_unit', 'desc_units', name=_('Numbering')),
|
||||||
FieldSet('weight', 'max_weight', 'weight_unit', name=_('Weight')),
|
FieldSet('weight', 'max_weight', 'weight_unit', name=_('Weight')),
|
||||||
@@ -320,7 +325,7 @@ class RackTypeFilterForm(RackBaseFilterForm):
|
|||||||
class RackFilterForm(TenancyFilterForm, ContactModelFilterForm, RackBaseFilterForm):
|
class RackFilterForm(TenancyFilterForm, ContactModelFilterForm, RackBaseFilterForm):
|
||||||
model = Rack
|
model = Rack
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('region_id', 'site_group_id', 'site_id', 'location_id', name=_('Location')),
|
FieldSet('region_id', 'site_group_id', 'site_id', 'location_id', name=_('Location')),
|
||||||
FieldSet('tenant_group_id', 'tenant_id', name=_('Tenant')),
|
FieldSet('tenant_group_id', 'tenant_id', name=_('Tenant')),
|
||||||
FieldSet('status', 'role_id', 'manufacturer_id', 'rack_type_id', 'serial', 'asset_tag', name=_('Rack')),
|
FieldSet('status', 'role_id', 'manufacturer_id', 'rack_type_id', 'serial', 'asset_tag', name=_('Rack')),
|
||||||
@@ -416,7 +421,7 @@ class RackElevationFilterForm(RackFilterForm):
|
|||||||
class RackReservationFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
class RackReservationFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
||||||
model = RackReservation
|
model = RackReservation
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('status', 'user_id', name=_('Reservation')),
|
FieldSet('status', 'user_id', name=_('Reservation')),
|
||||||
FieldSet('region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id', name=_('Rack')),
|
FieldSet('region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id', name=_('Rack')),
|
||||||
FieldSet('tenant_group_id', 'tenant_id', name=_('Tenant')),
|
FieldSet('tenant_group_id', 'tenant_id', name=_('Tenant')),
|
||||||
@@ -474,7 +479,7 @@ class RackReservationFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
|||||||
class ManufacturerFilterForm(ContactModelFilterForm, NetBoxModelFilterSetForm):
|
class ManufacturerFilterForm(ContactModelFilterForm, NetBoxModelFilterSetForm):
|
||||||
model = Manufacturer
|
model = Manufacturer
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('contact', 'contact_role', 'contact_group', name=_('Contacts'))
|
FieldSet('contact', 'contact_role', 'contact_group', name=_('Contacts'))
|
||||||
)
|
)
|
||||||
tag = TagFilterField(model)
|
tag = TagFilterField(model)
|
||||||
@@ -483,7 +488,7 @@ class ManufacturerFilterForm(ContactModelFilterForm, NetBoxModelFilterSetForm):
|
|||||||
class DeviceTypeFilterForm(NetBoxModelFilterSetForm):
|
class DeviceTypeFilterForm(NetBoxModelFilterSetForm):
|
||||||
model = DeviceType
|
model = DeviceType
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet(
|
FieldSet(
|
||||||
'manufacturer_id', 'default_platform_id', 'part_number', 'subdevice_role', 'airflow', name=_('Hardware')
|
'manufacturer_id', 'default_platform_id', 'part_number', 'subdevice_role', 'airflow', name=_('Hardware')
|
||||||
),
|
),
|
||||||
@@ -611,7 +616,7 @@ class DeviceTypeFilterForm(NetBoxModelFilterSetForm):
|
|||||||
class ModuleTypeProfileFilterForm(NetBoxModelFilterSetForm):
|
class ModuleTypeProfileFilterForm(NetBoxModelFilterSetForm):
|
||||||
model = ModuleTypeProfile
|
model = ModuleTypeProfile
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
)
|
)
|
||||||
selector_fields = ('filter_id', 'q')
|
selector_fields = ('filter_id', 'q')
|
||||||
|
|
||||||
@@ -619,7 +624,7 @@ class ModuleTypeProfileFilterForm(NetBoxModelFilterSetForm):
|
|||||||
class ModuleTypeFilterForm(NetBoxModelFilterSetForm):
|
class ModuleTypeFilterForm(NetBoxModelFilterSetForm):
|
||||||
model = ModuleType
|
model = ModuleType
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('profile_id', 'manufacturer_id', 'part_number', 'airflow', name=_('Hardware')),
|
FieldSet('profile_id', 'manufacturer_id', 'part_number', 'airflow', name=_('Hardware')),
|
||||||
FieldSet(
|
FieldSet(
|
||||||
'console_ports', 'console_server_ports', 'power_ports', 'power_outlets', 'interfaces',
|
'console_ports', 'console_server_ports', 'power_ports', 'power_outlets', 'interfaces',
|
||||||
@@ -703,6 +708,10 @@ class ModuleTypeFilterForm(NetBoxModelFilterSetForm):
|
|||||||
|
|
||||||
class DeviceRoleFilterForm(NetBoxModelFilterSetForm):
|
class DeviceRoleFilterForm(NetBoxModelFilterSetForm):
|
||||||
model = DeviceRole
|
model = DeviceRole
|
||||||
|
fieldsets = (
|
||||||
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
|
FieldSet('parent_id', 'config_template_id', name=_('Device Role'))
|
||||||
|
)
|
||||||
config_template_id = DynamicModelMultipleChoiceField(
|
config_template_id = DynamicModelMultipleChoiceField(
|
||||||
queryset=ConfigTemplate.objects.all(),
|
queryset=ConfigTemplate.objects.all(),
|
||||||
required=False,
|
required=False,
|
||||||
@@ -718,6 +727,10 @@ class DeviceRoleFilterForm(NetBoxModelFilterSetForm):
|
|||||||
|
|
||||||
class PlatformFilterForm(NetBoxModelFilterSetForm):
|
class PlatformFilterForm(NetBoxModelFilterSetForm):
|
||||||
model = Platform
|
model = Platform
|
||||||
|
fieldsets = (
|
||||||
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
|
FieldSet('manufacturer_id', 'parent_id', 'config_template_id', name=_('Platform'))
|
||||||
|
)
|
||||||
selector_fields = ('filter_id', 'q', 'manufacturer_id')
|
selector_fields = ('filter_id', 'q', 'manufacturer_id')
|
||||||
parent_id = DynamicModelMultipleChoiceField(
|
parent_id = DynamicModelMultipleChoiceField(
|
||||||
queryset=Platform.objects.all(),
|
queryset=Platform.objects.all(),
|
||||||
@@ -745,7 +758,7 @@ class DeviceFilterForm(
|
|||||||
):
|
):
|
||||||
model = Device
|
model = Device
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id', name=_('Location')),
|
FieldSet('region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id', name=_('Location')),
|
||||||
FieldSet('status', 'role_id', 'airflow', 'serial', 'asset_tag', 'mac_address', name=_('Operation')),
|
FieldSet('status', 'role_id', 'airflow', 'serial', 'asset_tag', 'mac_address', name=_('Operation')),
|
||||||
FieldSet('manufacturer_id', 'device_type_id', 'platform_id', name=_('Hardware')),
|
FieldSet('manufacturer_id', 'device_type_id', 'platform_id', name=_('Hardware')),
|
||||||
@@ -941,7 +954,7 @@ class VirtualDeviceContextFilterForm(
|
|||||||
):
|
):
|
||||||
model = VirtualDeviceContext
|
model = VirtualDeviceContext
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('device', 'status', 'has_primary_ip', name=_('Attributes')),
|
FieldSet('device', 'status', 'has_primary_ip', name=_('Attributes')),
|
||||||
FieldSet('tenant_group_id', 'tenant_id', name=_('Tenant')),
|
FieldSet('tenant_group_id', 'tenant_id', name=_('Tenant')),
|
||||||
)
|
)
|
||||||
@@ -968,7 +981,7 @@ class VirtualDeviceContextFilterForm(
|
|||||||
class ModuleFilterForm(LocalConfigContextFilterForm, TenancyFilterForm, NetBoxModelFilterSetForm):
|
class ModuleFilterForm(LocalConfigContextFilterForm, TenancyFilterForm, NetBoxModelFilterSetForm):
|
||||||
model = Module
|
model = Module
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id', 'device_id', name=_('Location')),
|
FieldSet('region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id', 'device_id', name=_('Location')),
|
||||||
FieldSet('manufacturer_id', 'module_type_id', 'status', 'serial', 'asset_tag', name=_('Hardware')),
|
FieldSet('manufacturer_id', 'module_type_id', 'status', 'serial', 'asset_tag', name=_('Hardware')),
|
||||||
)
|
)
|
||||||
@@ -1051,7 +1064,7 @@ class ModuleFilterForm(LocalConfigContextFilterForm, TenancyFilterForm, NetBoxMo
|
|||||||
class VirtualChassisFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
class VirtualChassisFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
||||||
model = VirtualChassis
|
model = VirtualChassis
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('region_id', 'site_group_id', 'site_id', name=_('Location')),
|
FieldSet('region_id', 'site_group_id', 'site_id', name=_('Location')),
|
||||||
FieldSet('tenant_group_id', 'tenant_id', name=_('Tenant')),
|
FieldSet('tenant_group_id', 'tenant_id', name=_('Tenant')),
|
||||||
)
|
)
|
||||||
@@ -1080,7 +1093,7 @@ class VirtualChassisFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
|||||||
class CableFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
class CableFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
||||||
model = Cable
|
model = Cable
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('site_id', 'location_id', 'rack_id', 'device_id', name=_('Location')),
|
FieldSet('site_id', 'location_id', 'rack_id', 'device_id', name=_('Location')),
|
||||||
FieldSet('type', 'status', 'color', 'length', 'length_unit', 'unterminated', name=_('Attributes')),
|
FieldSet('type', 'status', 'color', 'length', 'length_unit', 'unterminated', name=_('Attributes')),
|
||||||
FieldSet('tenant_group_id', 'tenant_id', name=_('Tenant')),
|
FieldSet('tenant_group_id', 'tenant_id', name=_('Tenant')),
|
||||||
@@ -1164,7 +1177,7 @@ class CableFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
|||||||
class PowerPanelFilterForm(ContactModelFilterForm, NetBoxModelFilterSetForm):
|
class PowerPanelFilterForm(ContactModelFilterForm, NetBoxModelFilterSetForm):
|
||||||
model = PowerPanel
|
model = PowerPanel
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('region_id', 'site_group_id', 'site_id', 'location_id', name=_('Location')),
|
FieldSet('region_id', 'site_group_id', 'site_id', 'location_id', name=_('Location')),
|
||||||
FieldSet('contact', 'contact_role', 'contact_group', name=_('Contacts')),
|
FieldSet('contact', 'contact_role', 'contact_group', name=_('Contacts')),
|
||||||
)
|
)
|
||||||
@@ -1203,7 +1216,7 @@ class PowerPanelFilterForm(ContactModelFilterForm, NetBoxModelFilterSetForm):
|
|||||||
class PowerFeedFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
class PowerFeedFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
||||||
model = PowerFeed
|
model = PowerFeed
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('region_id', 'site_group_id', 'site_id', 'power_panel_id', 'rack_id', name=_('Location')),
|
FieldSet('region_id', 'site_group_id', 'site_id', 'power_panel_id', 'rack_id', name=_('Location')),
|
||||||
FieldSet('tenant_group_id', 'tenant_id', name=_('Tenant')),
|
FieldSet('tenant_group_id', 'tenant_id', name=_('Tenant')),
|
||||||
FieldSet('status', 'type', 'supply', 'phase', 'voltage', 'amperage', 'max_utilization', name=_('Attributes')),
|
FieldSet('status', 'type', 'supply', 'phase', 'voltage', 'amperage', 'max_utilization', name=_('Attributes')),
|
||||||
@@ -1313,7 +1326,7 @@ class PathEndpointFilterForm(CabledFilterForm):
|
|||||||
class ConsolePortFilterForm(PathEndpointFilterForm, DeviceComponentFilterForm):
|
class ConsolePortFilterForm(PathEndpointFilterForm, DeviceComponentFilterForm):
|
||||||
model = ConsolePort
|
model = ConsolePort
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('name', 'label', 'type', 'speed', name=_('Attributes')),
|
FieldSet('name', 'label', 'type', 'speed', name=_('Attributes')),
|
||||||
FieldSet('region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id', name=_('Location')),
|
FieldSet('region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id', name=_('Location')),
|
||||||
FieldSet(
|
FieldSet(
|
||||||
@@ -1337,7 +1350,7 @@ class ConsolePortFilterForm(PathEndpointFilterForm, DeviceComponentFilterForm):
|
|||||||
class ConsoleServerPortFilterForm(PathEndpointFilterForm, DeviceComponentFilterForm):
|
class ConsoleServerPortFilterForm(PathEndpointFilterForm, DeviceComponentFilterForm):
|
||||||
model = ConsoleServerPort
|
model = ConsoleServerPort
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('name', 'label', 'type', 'speed', name=_('Attributes')),
|
FieldSet('name', 'label', 'type', 'speed', name=_('Attributes')),
|
||||||
FieldSet('region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id', name=_('Location')),
|
FieldSet('region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id', name=_('Location')),
|
||||||
FieldSet(
|
FieldSet(
|
||||||
@@ -1362,7 +1375,7 @@ class ConsoleServerPortFilterForm(PathEndpointFilterForm, DeviceComponentFilterF
|
|||||||
class PowerPortFilterForm(PathEndpointFilterForm, DeviceComponentFilterForm):
|
class PowerPortFilterForm(PathEndpointFilterForm, DeviceComponentFilterForm):
|
||||||
model = PowerPort
|
model = PowerPort
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('name', 'label', 'type', name=_('Attributes')),
|
FieldSet('name', 'label', 'type', name=_('Attributes')),
|
||||||
FieldSet('region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id', name=_('Location')),
|
FieldSet('region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id', name=_('Location')),
|
||||||
FieldSet(
|
FieldSet(
|
||||||
@@ -1381,7 +1394,7 @@ class PowerPortFilterForm(PathEndpointFilterForm, DeviceComponentFilterForm):
|
|||||||
class PowerOutletFilterForm(PathEndpointFilterForm, DeviceComponentFilterForm):
|
class PowerOutletFilterForm(PathEndpointFilterForm, DeviceComponentFilterForm):
|
||||||
model = PowerOutlet
|
model = PowerOutlet
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('name', 'label', 'type', 'color', 'status', name=_('Attributes')),
|
FieldSet('name', 'label', 'type', 'color', 'status', name=_('Attributes')),
|
||||||
FieldSet('region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id', name=_('Location')),
|
FieldSet('region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id', name=_('Location')),
|
||||||
FieldSet(
|
FieldSet(
|
||||||
@@ -1410,7 +1423,7 @@ class PowerOutletFilterForm(PathEndpointFilterForm, DeviceComponentFilterForm):
|
|||||||
class InterfaceFilterForm(PathEndpointFilterForm, DeviceComponentFilterForm):
|
class InterfaceFilterForm(PathEndpointFilterForm, DeviceComponentFilterForm):
|
||||||
model = Interface
|
model = Interface
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('name', 'label', 'kind', 'type', 'speed', 'duplex', 'enabled', 'mgmt_only', name=_('Attributes')),
|
FieldSet('name', 'label', 'kind', 'type', 'speed', 'duplex', 'enabled', 'mgmt_only', name=_('Attributes')),
|
||||||
FieldSet('vrf_id', 'l2vpn_id', 'mac_address', 'wwn', name=_('Addressing')),
|
FieldSet('vrf_id', 'l2vpn_id', 'mac_address', 'wwn', name=_('Addressing')),
|
||||||
FieldSet('poe_mode', 'poe_type', name=_('PoE')),
|
FieldSet('poe_mode', 'poe_type', name=_('PoE')),
|
||||||
@@ -1535,7 +1548,7 @@ class InterfaceFilterForm(PathEndpointFilterForm, DeviceComponentFilterForm):
|
|||||||
|
|
||||||
class FrontPortFilterForm(CabledFilterForm, DeviceComponentFilterForm):
|
class FrontPortFilterForm(CabledFilterForm, DeviceComponentFilterForm):
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('name', 'label', 'type', 'color', name=_('Attributes')),
|
FieldSet('name', 'label', 'type', 'color', name=_('Attributes')),
|
||||||
FieldSet('region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id', name=_('Location')),
|
FieldSet('region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id', name=_('Location')),
|
||||||
FieldSet(
|
FieldSet(
|
||||||
@@ -1559,7 +1572,7 @@ class FrontPortFilterForm(CabledFilterForm, DeviceComponentFilterForm):
|
|||||||
class RearPortFilterForm(CabledFilterForm, DeviceComponentFilterForm):
|
class RearPortFilterForm(CabledFilterForm, DeviceComponentFilterForm):
|
||||||
model = RearPort
|
model = RearPort
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('name', 'label', 'type', 'color', name=_('Attributes')),
|
FieldSet('name', 'label', 'type', 'color', name=_('Attributes')),
|
||||||
FieldSet('region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id', name=_('Location')),
|
FieldSet('region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id', name=_('Location')),
|
||||||
FieldSet(
|
FieldSet(
|
||||||
@@ -1583,7 +1596,7 @@ class RearPortFilterForm(CabledFilterForm, DeviceComponentFilterForm):
|
|||||||
class ModuleBayFilterForm(DeviceComponentFilterForm):
|
class ModuleBayFilterForm(DeviceComponentFilterForm):
|
||||||
model = ModuleBay
|
model = ModuleBay
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('name', 'label', 'position', name=_('Attributes')),
|
FieldSet('name', 'label', 'position', name=_('Attributes')),
|
||||||
FieldSet('region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id', name=_('Location')),
|
FieldSet('region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id', name=_('Location')),
|
||||||
FieldSet(
|
FieldSet(
|
||||||
@@ -1601,7 +1614,7 @@ class ModuleBayFilterForm(DeviceComponentFilterForm):
|
|||||||
class DeviceBayFilterForm(DeviceComponentFilterForm):
|
class DeviceBayFilterForm(DeviceComponentFilterForm):
|
||||||
model = DeviceBay
|
model = DeviceBay
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('name', 'label', name=_('Attributes')),
|
FieldSet('name', 'label', name=_('Attributes')),
|
||||||
FieldSet('region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id', name=_('Location')),
|
FieldSet('region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id', name=_('Location')),
|
||||||
FieldSet(
|
FieldSet(
|
||||||
@@ -1615,7 +1628,7 @@ class DeviceBayFilterForm(DeviceComponentFilterForm):
|
|||||||
class InventoryItemFilterForm(DeviceComponentFilterForm):
|
class InventoryItemFilterForm(DeviceComponentFilterForm):
|
||||||
model = InventoryItem
|
model = InventoryItem
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet(
|
FieldSet(
|
||||||
'name', 'label', 'status', 'role_id', 'manufacturer_id', 'serial', 'asset_tag', 'discovered',
|
'name', 'label', 'status', 'role_id', 'manufacturer_id', 'serial', 'asset_tag', 'discovered',
|
||||||
name=_('Attributes')
|
name=_('Attributes')
|
||||||
@@ -1665,6 +1678,9 @@ class InventoryItemFilterForm(DeviceComponentFilterForm):
|
|||||||
|
|
||||||
class InventoryItemRoleFilterForm(NetBoxModelFilterSetForm):
|
class InventoryItemRoleFilterForm(NetBoxModelFilterSetForm):
|
||||||
model = InventoryItemRole
|
model = InventoryItemRole
|
||||||
|
fieldsets = (
|
||||||
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
|
)
|
||||||
tag = TagFilterField(model)
|
tag = TagFilterField(model)
|
||||||
|
|
||||||
|
|
||||||
@@ -1675,7 +1691,7 @@ class InventoryItemRoleFilterForm(NetBoxModelFilterSetForm):
|
|||||||
class MACAddressFilterForm(NetBoxModelFilterSetForm):
|
class MACAddressFilterForm(NetBoxModelFilterSetForm):
|
||||||
model = MACAddress
|
model = MACAddress
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('mac_address', 'device_id', 'virtual_machine_id', name=_('MAC address')),
|
FieldSet('mac_address', 'device_id', 'virtual_machine_id', name=_('MAC address')),
|
||||||
)
|
)
|
||||||
selector_fields = ('filter_id', 'q', 'device_id', 'virtual_machine_id')
|
selector_fields = ('filter_id', 'q', 'device_id', 'virtual_machine_id')
|
||||||
|
|||||||
@@ -290,7 +290,7 @@ class TableConfigFilterForm(SavedFiltersMixin, FilterForm):
|
|||||||
class WebhookFilterForm(NetBoxModelFilterSetForm):
|
class WebhookFilterForm(NetBoxModelFilterSetForm):
|
||||||
model = Webhook
|
model = Webhook
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('payload_url', 'http_method', 'http_content_type', name=_('Attributes')),
|
FieldSet('payload_url', 'http_method', 'http_content_type', name=_('Attributes')),
|
||||||
)
|
)
|
||||||
http_content_type = forms.CharField(
|
http_content_type = forms.CharField(
|
||||||
@@ -311,10 +311,8 @@ class WebhookFilterForm(NetBoxModelFilterSetForm):
|
|||||||
|
|
||||||
class EventRuleFilterForm(NetBoxModelFilterSetForm):
|
class EventRuleFilterForm(NetBoxModelFilterSetForm):
|
||||||
model = EventRule
|
model = EventRule
|
||||||
tag = TagFilterField(model)
|
|
||||||
|
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('object_type_id', 'event_type', 'action_type', 'enabled', name=_('Attributes')),
|
FieldSet('object_type_id', 'event_type', 'action_type', 'enabled', name=_('Attributes')),
|
||||||
)
|
)
|
||||||
object_type_id = ContentTypeMultipleChoiceField(
|
object_type_id = ContentTypeMultipleChoiceField(
|
||||||
@@ -339,6 +337,7 @@ class EventRuleFilterForm(NetBoxModelFilterSetForm):
|
|||||||
choices=BOOLEAN_WITH_BLANK_CHOICES
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
tag = TagFilterField(model)
|
||||||
|
|
||||||
|
|
||||||
class TagFilterForm(SavedFiltersMixin, FilterForm):
|
class TagFilterForm(SavedFiltersMixin, FilterForm):
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ IPADDRESS_MASK_LENGTH_CHOICES = add_blank_choice([
|
|||||||
class VRFFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
class VRFFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
||||||
model = VRF
|
model = VRF
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('import_target_id', 'export_target_id', name=_('Route Targets')),
|
FieldSet('import_target_id', 'export_target_id', name=_('Route Targets')),
|
||||||
FieldSet('tenant_group_id', 'tenant_id', name=_('Tenant')),
|
FieldSet('tenant_group_id', 'tenant_id', name=_('Tenant')),
|
||||||
)
|
)
|
||||||
@@ -65,7 +65,7 @@ class VRFFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
|||||||
class RouteTargetFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
class RouteTargetFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
||||||
model = RouteTarget
|
model = RouteTarget
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('importing_vrf_id', 'exporting_vrf_id', name=_('VRF')),
|
FieldSet('importing_vrf_id', 'exporting_vrf_id', name=_('VRF')),
|
||||||
FieldSet('tenant_group_id', 'tenant_id', name=_('Tenant')),
|
FieldSet('tenant_group_id', 'tenant_id', name=_('Tenant')),
|
||||||
)
|
)
|
||||||
@@ -84,6 +84,10 @@ class RouteTargetFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
|||||||
|
|
||||||
class RIRFilterForm(NetBoxModelFilterSetForm):
|
class RIRFilterForm(NetBoxModelFilterSetForm):
|
||||||
model = RIR
|
model = RIR
|
||||||
|
fieldsets = (
|
||||||
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
|
FieldSet('is_private', name=_('RIR')),
|
||||||
|
)
|
||||||
is_private = forms.NullBooleanField(
|
is_private = forms.NullBooleanField(
|
||||||
required=False,
|
required=False,
|
||||||
label=_('Private'),
|
label=_('Private'),
|
||||||
@@ -97,7 +101,7 @@ class RIRFilterForm(NetBoxModelFilterSetForm):
|
|||||||
class AggregateFilterForm(ContactModelFilterForm, TenancyFilterForm, NetBoxModelFilterSetForm):
|
class AggregateFilterForm(ContactModelFilterForm, TenancyFilterForm, NetBoxModelFilterSetForm):
|
||||||
model = Aggregate
|
model = Aggregate
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('family', 'rir_id', name=_('Attributes')),
|
FieldSet('family', 'rir_id', name=_('Attributes')),
|
||||||
FieldSet('tenant_group_id', 'tenant_id', name=_('Tenant')),
|
FieldSet('tenant_group_id', 'tenant_id', name=_('Tenant')),
|
||||||
FieldSet('contact', 'contact_role', 'contact_group', name=_('Contacts')),
|
FieldSet('contact', 'contact_role', 'contact_group', name=_('Contacts')),
|
||||||
@@ -118,7 +122,7 @@ class AggregateFilterForm(ContactModelFilterForm, TenancyFilterForm, NetBoxModel
|
|||||||
class ASNRangeFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
class ASNRangeFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
||||||
model = ASNRange
|
model = ASNRange
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('rir_id', 'start', 'end', name=_('Range')),
|
FieldSet('rir_id', 'start', 'end', name=_('Range')),
|
||||||
FieldSet('tenant_group_id', 'tenant_id', name=_('Tenant')),
|
FieldSet('tenant_group_id', 'tenant_id', name=_('Tenant')),
|
||||||
)
|
)
|
||||||
@@ -141,7 +145,7 @@ class ASNRangeFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
|||||||
class ASNFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
class ASNFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
||||||
model = ASN
|
model = ASN
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('rir_id', 'site_group_id', 'site_id', name=_('Assignment')),
|
FieldSet('rir_id', 'site_group_id', 'site_id', name=_('Assignment')),
|
||||||
FieldSet('tenant_group_id', 'tenant_id', name=_('Tenant')),
|
FieldSet('tenant_group_id', 'tenant_id', name=_('Tenant')),
|
||||||
)
|
)
|
||||||
@@ -165,13 +169,16 @@ class ASNFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
|||||||
|
|
||||||
class RoleFilterForm(NetBoxModelFilterSetForm):
|
class RoleFilterForm(NetBoxModelFilterSetForm):
|
||||||
model = Role
|
model = Role
|
||||||
|
fieldsets = (
|
||||||
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
|
)
|
||||||
tag = TagFilterField(model)
|
tag = TagFilterField(model)
|
||||||
|
|
||||||
|
|
||||||
class PrefixFilterForm(ContactModelFilterForm, TenancyFilterForm, NetBoxModelFilterSetForm, ):
|
class PrefixFilterForm(ContactModelFilterForm, TenancyFilterForm, NetBoxModelFilterSetForm, ):
|
||||||
model = Prefix
|
model = Prefix
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet(
|
FieldSet(
|
||||||
'within_include', 'family', 'status', 'role_id', 'mask_length', 'is_pool', 'mark_utilized',
|
'within_include', 'family', 'status', 'role_id', 'mask_length', 'is_pool', 'mark_utilized',
|
||||||
name=_('Addressing')
|
name=_('Addressing')
|
||||||
@@ -277,7 +284,7 @@ class PrefixFilterForm(ContactModelFilterForm, TenancyFilterForm, NetBoxModelFil
|
|||||||
class IPRangeFilterForm(ContactModelFilterForm, TenancyFilterForm, NetBoxModelFilterSetForm):
|
class IPRangeFilterForm(ContactModelFilterForm, TenancyFilterForm, NetBoxModelFilterSetForm):
|
||||||
model = IPRange
|
model = IPRange
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('family', 'vrf_id', 'status', 'role_id', 'mark_populated', 'mark_utilized', name=_('Attributes')),
|
FieldSet('family', 'vrf_id', 'status', 'role_id', 'mark_populated', 'mark_utilized', name=_('Attributes')),
|
||||||
FieldSet('tenant_group_id', 'tenant_id', name=_('Tenant')),
|
FieldSet('tenant_group_id', 'tenant_id', name=_('Tenant')),
|
||||||
FieldSet('contact', 'contact_role', 'contact_group', name=_('Contacts')),
|
FieldSet('contact', 'contact_role', 'contact_group', name=_('Contacts')),
|
||||||
@@ -324,7 +331,7 @@ class IPRangeFilterForm(ContactModelFilterForm, TenancyFilterForm, NetBoxModelFi
|
|||||||
class IPAddressFilterForm(ContactModelFilterForm, TenancyFilterForm, NetBoxModelFilterSetForm):
|
class IPAddressFilterForm(ContactModelFilterForm, TenancyFilterForm, NetBoxModelFilterSetForm):
|
||||||
model = IPAddress
|
model = IPAddress
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet(
|
FieldSet(
|
||||||
'parent', 'family', 'status', 'role', 'mask_length', 'assigned_to_interface', 'dns_name',
|
'parent', 'family', 'status', 'role', 'mask_length', 'assigned_to_interface', 'dns_name',
|
||||||
name=_('Attributes')
|
name=_('Attributes')
|
||||||
@@ -402,7 +409,7 @@ class IPAddressFilterForm(ContactModelFilterForm, TenancyFilterForm, NetBoxModel
|
|||||||
class FHRPGroupFilterForm(NetBoxModelFilterSetForm):
|
class FHRPGroupFilterForm(NetBoxModelFilterSetForm):
|
||||||
model = FHRPGroup
|
model = FHRPGroup
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('name', 'protocol', 'group_id', name=_('Attributes')),
|
FieldSet('name', 'protocol', 'group_id', name=_('Attributes')),
|
||||||
FieldSet('auth_type', 'auth_key', name=_('Authentication')),
|
FieldSet('auth_type', 'auth_key', name=_('Authentication')),
|
||||||
)
|
)
|
||||||
@@ -434,7 +441,7 @@ class FHRPGroupFilterForm(NetBoxModelFilterSetForm):
|
|||||||
|
|
||||||
class VLANGroupFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
class VLANGroupFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('region', 'site_group', 'site', 'location', 'rack', name=_('Location')),
|
FieldSet('region', 'site_group', 'site', 'location', 'rack', name=_('Location')),
|
||||||
FieldSet('cluster_group', 'cluster', name=_('Cluster')),
|
FieldSet('cluster_group', 'cluster', name=_('Cluster')),
|
||||||
FieldSet('contains_vid', name=_('VLANs')),
|
FieldSet('contains_vid', name=_('VLANs')),
|
||||||
@@ -488,7 +495,7 @@ class VLANGroupFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
|||||||
class VLANTranslationPolicyFilterForm(NetBoxModelFilterSetForm):
|
class VLANTranslationPolicyFilterForm(NetBoxModelFilterSetForm):
|
||||||
model = VLANTranslationPolicy
|
model = VLANTranslationPolicy
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('name', name=_('Attributes')),
|
FieldSet('name', name=_('Attributes')),
|
||||||
)
|
)
|
||||||
name = forms.CharField(
|
name = forms.CharField(
|
||||||
@@ -525,7 +532,7 @@ class VLANTranslationRuleFilterForm(NetBoxModelFilterSetForm):
|
|||||||
class VLANFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
class VLANFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
||||||
model = VLAN
|
model = VLAN
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('region_id', 'site_group_id', 'site_id', name=_('Location')),
|
FieldSet('region_id', 'site_group_id', 'site_id', name=_('Location')),
|
||||||
FieldSet('group_id', 'status', 'role_id', 'vid', 'l2vpn_id', name=_('Attributes')),
|
FieldSet('group_id', 'status', 'role_id', 'vid', 'l2vpn_id', name=_('Attributes')),
|
||||||
FieldSet('qinq_role', 'qinq_svlan_id', name=_('Q-in-Q/802.1ad')),
|
FieldSet('qinq_role', 'qinq_svlan_id', name=_('Q-in-Q/802.1ad')),
|
||||||
@@ -597,7 +604,7 @@ class VLANFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
|||||||
class ServiceTemplateFilterForm(NetBoxModelFilterSetForm):
|
class ServiceTemplateFilterForm(NetBoxModelFilterSetForm):
|
||||||
model = ServiceTemplate
|
model = ServiceTemplate
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('protocol', 'port', name=_('Attributes')),
|
FieldSet('protocol', 'port', name=_('Attributes')),
|
||||||
)
|
)
|
||||||
protocol = forms.ChoiceField(
|
protocol = forms.ChoiceField(
|
||||||
@@ -615,7 +622,7 @@ class ServiceTemplateFilterForm(NetBoxModelFilterSetForm):
|
|||||||
class ServiceFilterForm(ContactModelFilterForm, ServiceTemplateFilterForm):
|
class ServiceFilterForm(ContactModelFilterForm, ServiceTemplateFilterForm):
|
||||||
model = Service
|
model = Service
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('protocol', 'port', name=_('Attributes')),
|
FieldSet('protocol', 'port', name=_('Attributes')),
|
||||||
FieldSet('device_id', 'virtual_machine_id', 'fhrpgroup_id', name=_('Assignment')),
|
FieldSet('device_id', 'virtual_machine_id', 'fhrpgroup_id', name=_('Assignment')),
|
||||||
FieldSet('contact', 'contact_role', 'contact_group', name=_('Contacts')),
|
FieldSet('contact', 'contact_role', 'contact_group', name=_('Contacts')),
|
||||||
|
|||||||
@@ -8,8 +8,9 @@ from django.utils.translation import gettext_lazy as _
|
|||||||
from core.models import ObjectType
|
from core.models import ObjectType
|
||||||
from extras.choices import *
|
from extras.choices import *
|
||||||
from extras.models import CustomField, Tag
|
from extras.models import CustomField, Tag
|
||||||
|
from users.models import Owner
|
||||||
from utilities.forms import BulkEditForm, CSVModelForm
|
from utilities.forms import BulkEditForm, CSVModelForm
|
||||||
from utilities.forms.fields import CSVModelMultipleChoiceField, DynamicModelMultipleChoiceField
|
from utilities.forms.fields import CSVModelMultipleChoiceField, DynamicModelMultipleChoiceField, CSVModelChoiceField
|
||||||
from utilities.forms.mixins import CheckLastUpdatedMixin
|
from utilities.forms.mixins import CheckLastUpdatedMixin
|
||||||
from .mixins import ChangelogMessageMixin, CustomFieldsMixin, OwnerMixin, SavedFiltersMixin, TagsMixin
|
from .mixins import ChangelogMessageMixin, CustomFieldsMixin, OwnerMixin, SavedFiltersMixin, TagsMixin
|
||||||
|
|
||||||
@@ -87,8 +88,14 @@ class NetBoxModelForm(
|
|||||||
|
|
||||||
class NetBoxModelImportForm(CSVModelForm, NetBoxModelForm):
|
class NetBoxModelImportForm(CSVModelForm, NetBoxModelForm):
|
||||||
"""
|
"""
|
||||||
Base form for creating a NetBox objects from CSV data. Used for bulk importing.
|
Base form for creating NetBox objects from CSV data. Used for bulk importing.
|
||||||
"""
|
"""
|
||||||
|
owner = CSVModelChoiceField(
|
||||||
|
queryset=Owner.objects.all(),
|
||||||
|
required=False,
|
||||||
|
to_field_name='name',
|
||||||
|
help_text=_("Name of the object's owner")
|
||||||
|
)
|
||||||
tags = CSVModelMultipleChoiceField(
|
tags = CSVModelMultipleChoiceField(
|
||||||
label=_('Tags'),
|
label=_('Tags'),
|
||||||
queryset=Tag.objects.all(),
|
queryset=Tag.objects.all(),
|
||||||
@@ -149,11 +156,16 @@ class NetBoxModelBulkEditForm(ChangelogMessageMixin, CustomFieldsMixin, OwnerMix
|
|||||||
return customfield.to_form_field(set_initial=False, enforce_required=False)
|
return customfield.to_form_field(set_initial=False, enforce_required=False)
|
||||||
|
|
||||||
def _extend_nullable_fields(self):
|
def _extend_nullable_fields(self):
|
||||||
|
nullable_common_fields = ['owner']
|
||||||
nullable_custom_fields = [
|
nullable_custom_fields = [
|
||||||
name for name, customfield in self.custom_fields.items()
|
name for name, customfield in self.custom_fields.items()
|
||||||
if (not customfield.required and customfield.ui_editable == CustomFieldUIEditableChoices.YES)
|
if (not customfield.required and customfield.ui_editable == CustomFieldUIEditableChoices.YES)
|
||||||
]
|
]
|
||||||
self.nullable_fields = (*self.nullable_fields, *nullable_custom_fields)
|
self.nullable_fields = (
|
||||||
|
*self.nullable_fields,
|
||||||
|
*nullable_common_fields,
|
||||||
|
*nullable_custom_fields,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class NetBoxModelFilterSetForm(CustomFieldsMixin, SavedFiltersMixin, forms.Form):
|
class NetBoxModelFilterSetForm(CustomFieldsMixin, SavedFiltersMixin, forms.Form):
|
||||||
@@ -172,6 +184,11 @@ class NetBoxModelFilterSetForm(CustomFieldsMixin, SavedFiltersMixin, forms.Form)
|
|||||||
required=False,
|
required=False,
|
||||||
label=_('Search')
|
label=_('Search')
|
||||||
)
|
)
|
||||||
|
owner_id = DynamicModelMultipleChoiceField(
|
||||||
|
queryset=Owner.objects.all(),
|
||||||
|
required=False,
|
||||||
|
label=_('Owner'),
|
||||||
|
)
|
||||||
|
|
||||||
selector_fields = ('filter_id', 'q')
|
selector_fields = ('filter_id', 'q')
|
||||||
|
|
||||||
|
|||||||
@@ -58,6 +58,16 @@ Context:
|
|||||||
{% render_fieldset form fieldset %}
|
{% render_fieldset form fieldset %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
|
{# Render owner field (if defined) #}
|
||||||
|
{% if form.owner %}
|
||||||
|
<div class="field-group mb-5">
|
||||||
|
<div class="row">
|
||||||
|
<h2 class="col-9 offset-3">{% trans "Owner" %}</h2>
|
||||||
|
</div>
|
||||||
|
{% render_field form.owner bulk_nullable=True %}
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{# Render tag add/remove fields #}
|
{# Render tag add/remove fields #}
|
||||||
{% if form.add_tags and form.remove_tags %}
|
{% if form.add_tags and form.remove_tags %}
|
||||||
<div class="field-group mb-5">
|
<div class="field-group mb-5">
|
||||||
|
|||||||
@@ -27,6 +27,10 @@ __all__ = (
|
|||||||
|
|
||||||
class TenantGroupFilterForm(NetBoxModelFilterSetForm):
|
class TenantGroupFilterForm(NetBoxModelFilterSetForm):
|
||||||
model = TenantGroup
|
model = TenantGroup
|
||||||
|
fieldsets = (
|
||||||
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
|
FieldSet('parent_id', name=_('Tenant Group')),
|
||||||
|
)
|
||||||
parent_id = DynamicModelMultipleChoiceField(
|
parent_id = DynamicModelMultipleChoiceField(
|
||||||
queryset=TenantGroup.objects.all(),
|
queryset=TenantGroup.objects.all(),
|
||||||
required=False,
|
required=False,
|
||||||
@@ -38,7 +42,8 @@ class TenantGroupFilterForm(NetBoxModelFilterSetForm):
|
|||||||
class TenantFilterForm(ContactModelFilterForm, NetBoxModelFilterSetForm):
|
class TenantFilterForm(ContactModelFilterForm, NetBoxModelFilterSetForm):
|
||||||
model = Tenant
|
model = Tenant
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag', 'group_id'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
|
FieldSet('group_id', name=_('Tenant')),
|
||||||
FieldSet('contact', 'contact_role', 'contact_group', name=_('Contacts'))
|
FieldSet('contact', 'contact_role', 'contact_group', name=_('Contacts'))
|
||||||
)
|
)
|
||||||
group_id = DynamicModelMultipleChoiceField(
|
group_id = DynamicModelMultipleChoiceField(
|
||||||
@@ -56,6 +61,10 @@ class TenantFilterForm(ContactModelFilterForm, NetBoxModelFilterSetForm):
|
|||||||
|
|
||||||
class ContactGroupFilterForm(NetBoxModelFilterSetForm):
|
class ContactGroupFilterForm(NetBoxModelFilterSetForm):
|
||||||
model = ContactGroup
|
model = ContactGroup
|
||||||
|
fieldsets = (
|
||||||
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
|
FieldSet('parent_id', name=_('Contact Group')),
|
||||||
|
)
|
||||||
parent_id = DynamicModelMultipleChoiceField(
|
parent_id = DynamicModelMultipleChoiceField(
|
||||||
queryset=ContactGroup.objects.all(),
|
queryset=ContactGroup.objects.all(),
|
||||||
required=False,
|
required=False,
|
||||||
@@ -66,11 +75,18 @@ class ContactGroupFilterForm(NetBoxModelFilterSetForm):
|
|||||||
|
|
||||||
class ContactRoleFilterForm(NetBoxModelFilterSetForm):
|
class ContactRoleFilterForm(NetBoxModelFilterSetForm):
|
||||||
model = ContactRole
|
model = ContactRole
|
||||||
|
fieldsets = (
|
||||||
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
|
)
|
||||||
tag = TagFilterField(model)
|
tag = TagFilterField(model)
|
||||||
|
|
||||||
|
|
||||||
class ContactFilterForm(NetBoxModelFilterSetForm):
|
class ContactFilterForm(NetBoxModelFilterSetForm):
|
||||||
model = Contact
|
model = Contact
|
||||||
|
fieldsets = (
|
||||||
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
|
FieldSet('group_id', name=_('Contact')),
|
||||||
|
)
|
||||||
group_id = DynamicModelMultipleChoiceField(
|
group_id = DynamicModelMultipleChoiceField(
|
||||||
queryset=ContactGroup.objects.all(),
|
queryset=ContactGroup.objects.all(),
|
||||||
required=False,
|
required=False,
|
||||||
|
|||||||
@@ -27,6 +27,9 @@ __all__ = (
|
|||||||
|
|
||||||
class ClusterTypeFilterForm(NetBoxModelFilterSetForm):
|
class ClusterTypeFilterForm(NetBoxModelFilterSetForm):
|
||||||
model = ClusterType
|
model = ClusterType
|
||||||
|
fieldsets = (
|
||||||
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
|
)
|
||||||
tag = TagFilterField(model)
|
tag = TagFilterField(model)
|
||||||
|
|
||||||
|
|
||||||
@@ -34,7 +37,7 @@ class ClusterGroupFilterForm(ContactModelFilterForm, NetBoxModelFilterSetForm):
|
|||||||
model = ClusterGroup
|
model = ClusterGroup
|
||||||
tag = TagFilterField(model)
|
tag = TagFilterField(model)
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('contact', 'contact_role', 'contact_group', name=_('Contacts')),
|
FieldSet('contact', 'contact_role', 'contact_group', name=_('Contacts')),
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -42,7 +45,7 @@ class ClusterGroupFilterForm(ContactModelFilterForm, NetBoxModelFilterSetForm):
|
|||||||
class ClusterFilterForm(TenancyFilterForm, ContactModelFilterForm, NetBoxModelFilterSetForm):
|
class ClusterFilterForm(TenancyFilterForm, ContactModelFilterForm, NetBoxModelFilterSetForm):
|
||||||
model = Cluster
|
model = Cluster
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('group_id', 'type_id', 'status', name=_('Attributes')),
|
FieldSet('group_id', 'type_id', 'status', name=_('Attributes')),
|
||||||
FieldSet('region_id', 'site_group_id', 'site_id', 'location_id', name=_('Scope')),
|
FieldSet('region_id', 'site_group_id', 'site_id', 'location_id', name=_('Scope')),
|
||||||
FieldSet('tenant_group_id', 'tenant_id', name=_('Tenant')),
|
FieldSet('tenant_group_id', 'tenant_id', name=_('Tenant')),
|
||||||
@@ -101,7 +104,7 @@ class VirtualMachineFilterForm(
|
|||||||
):
|
):
|
||||||
model = VirtualMachine
|
model = VirtualMachine
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('cluster_group_id', 'cluster_type_id', 'cluster_id', 'device_id', name=_('Cluster')),
|
FieldSet('cluster_group_id', 'cluster_type_id', 'cluster_id', 'device_id', name=_('Cluster')),
|
||||||
FieldSet('region_id', 'site_group_id', 'site_id', name=_('Location')),
|
FieldSet('region_id', 'site_group_id', 'site_id', name=_('Location')),
|
||||||
FieldSet(
|
FieldSet(
|
||||||
@@ -199,7 +202,7 @@ class VirtualMachineFilterForm(
|
|||||||
class VMInterfaceFilterForm(NetBoxModelFilterSetForm):
|
class VMInterfaceFilterForm(NetBoxModelFilterSetForm):
|
||||||
model = VMInterface
|
model = VMInterface
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('cluster_id', 'virtual_machine_id', name=_('Virtual Machine')),
|
FieldSet('cluster_id', 'virtual_machine_id', name=_('Virtual Machine')),
|
||||||
FieldSet('enabled', name=_('Attributes')),
|
FieldSet('enabled', name=_('Attributes')),
|
||||||
FieldSet('vrf_id', 'l2vpn_id', 'mac_address', name=_('Addressing')),
|
FieldSet('vrf_id', 'l2vpn_id', 'mac_address', name=_('Addressing')),
|
||||||
@@ -256,7 +259,7 @@ class VMInterfaceFilterForm(NetBoxModelFilterSetForm):
|
|||||||
class VirtualDiskFilterForm(NetBoxModelFilterSetForm):
|
class VirtualDiskFilterForm(NetBoxModelFilterSetForm):
|
||||||
model = VirtualDisk
|
model = VirtualDisk
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('virtual_machine_id', name=_('Virtual Machine')),
|
FieldSet('virtual_machine_id', name=_('Virtual Machine')),
|
||||||
FieldSet('size', name=_('Attributes')),
|
FieldSet('size', name=_('Attributes')),
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ __all__ = (
|
|||||||
class TunnelGroupFilterForm(ContactModelFilterForm, NetBoxModelFilterSetForm):
|
class TunnelGroupFilterForm(ContactModelFilterForm, NetBoxModelFilterSetForm):
|
||||||
model = TunnelGroup
|
model = TunnelGroup
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('contact', 'contact_role', 'contact_group', name=_('Contacts')),
|
FieldSet('contact', 'contact_role', 'contact_group', name=_('Contacts')),
|
||||||
)
|
)
|
||||||
tag = TagFilterField(model)
|
tag = TagFilterField(model)
|
||||||
@@ -42,7 +42,7 @@ class TunnelGroupFilterForm(ContactModelFilterForm, NetBoxModelFilterSetForm):
|
|||||||
class TunnelFilterForm(ContactModelFilterForm, TenancyFilterForm, NetBoxModelFilterSetForm):
|
class TunnelFilterForm(ContactModelFilterForm, TenancyFilterForm, NetBoxModelFilterSetForm):
|
||||||
model = Tunnel
|
model = Tunnel
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('status', 'encapsulation', 'tunnel_id', name=_('Tunnel')),
|
FieldSet('status', 'encapsulation', 'tunnel_id', name=_('Tunnel')),
|
||||||
FieldSet('ipsec_profile_id', name=_('Security')),
|
FieldSet('ipsec_profile_id', name=_('Security')),
|
||||||
FieldSet('tenant_group_id', 'tenant_id', name=_('Tenancy')),
|
FieldSet('tenant_group_id', 'tenant_id', name=_('Tenancy')),
|
||||||
@@ -97,7 +97,7 @@ class TunnelTerminationFilterForm(NetBoxModelFilterSetForm):
|
|||||||
class IKEProposalFilterForm(NetBoxModelFilterSetForm):
|
class IKEProposalFilterForm(NetBoxModelFilterSetForm):
|
||||||
model = IKEProposal
|
model = IKEProposal
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet(
|
FieldSet(
|
||||||
'authentication_method', 'encryption_algorithm', 'authentication_algorithm', 'group', name=_('Parameters')
|
'authentication_method', 'encryption_algorithm', 'authentication_algorithm', 'group', name=_('Parameters')
|
||||||
),
|
),
|
||||||
@@ -128,7 +128,7 @@ class IKEProposalFilterForm(NetBoxModelFilterSetForm):
|
|||||||
class IKEPolicyFilterForm(NetBoxModelFilterSetForm):
|
class IKEPolicyFilterForm(NetBoxModelFilterSetForm):
|
||||||
model = IKEPolicy
|
model = IKEPolicy
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('version', 'mode', 'proposal_id', name=_('Parameters')),
|
FieldSet('version', 'mode', 'proposal_id', name=_('Parameters')),
|
||||||
)
|
)
|
||||||
version = forms.MultipleChoiceField(
|
version = forms.MultipleChoiceField(
|
||||||
@@ -152,7 +152,7 @@ class IKEPolicyFilterForm(NetBoxModelFilterSetForm):
|
|||||||
class IPSecProposalFilterForm(NetBoxModelFilterSetForm):
|
class IPSecProposalFilterForm(NetBoxModelFilterSetForm):
|
||||||
model = IPSecProposal
|
model = IPSecProposal
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('encryption_algorithm', 'authentication_algorithm', name=_('Parameters')),
|
FieldSet('encryption_algorithm', 'authentication_algorithm', name=_('Parameters')),
|
||||||
)
|
)
|
||||||
encryption_algorithm = forms.MultipleChoiceField(
|
encryption_algorithm = forms.MultipleChoiceField(
|
||||||
@@ -171,7 +171,7 @@ class IPSecProposalFilterForm(NetBoxModelFilterSetForm):
|
|||||||
class IPSecPolicyFilterForm(NetBoxModelFilterSetForm):
|
class IPSecPolicyFilterForm(NetBoxModelFilterSetForm):
|
||||||
model = IPSecPolicy
|
model = IPSecPolicy
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('proposal_id', 'pfs_group', name=_('Parameters')),
|
FieldSet('proposal_id', 'pfs_group', name=_('Parameters')),
|
||||||
)
|
)
|
||||||
proposal_id = DynamicModelMultipleChoiceField(
|
proposal_id = DynamicModelMultipleChoiceField(
|
||||||
@@ -190,7 +190,7 @@ class IPSecPolicyFilterForm(NetBoxModelFilterSetForm):
|
|||||||
class IPSecProfileFilterForm(NetBoxModelFilterSetForm):
|
class IPSecProfileFilterForm(NetBoxModelFilterSetForm):
|
||||||
model = IPSecProfile
|
model = IPSecProfile
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('mode', 'ike_policy_id', 'ipsec_policy_id', name=_('Profile')),
|
FieldSet('mode', 'ike_policy_id', 'ipsec_policy_id', name=_('Profile')),
|
||||||
)
|
)
|
||||||
mode = forms.MultipleChoiceField(
|
mode = forms.MultipleChoiceField(
|
||||||
@@ -214,7 +214,7 @@ class IPSecProfileFilterForm(NetBoxModelFilterSetForm):
|
|||||||
class L2VPNFilterForm(ContactModelFilterForm, TenancyFilterForm, NetBoxModelFilterSetForm):
|
class L2VPNFilterForm(ContactModelFilterForm, TenancyFilterForm, NetBoxModelFilterSetForm):
|
||||||
model = L2VPN
|
model = L2VPN
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('type', 'status', 'import_target_id', 'export_target_id', name=_('Attributes')),
|
FieldSet('type', 'status', 'import_target_id', 'export_target_id', name=_('Attributes')),
|
||||||
FieldSet('tenant_group_id', 'tenant_id', name=_('Tenant')),
|
FieldSet('tenant_group_id', 'tenant_id', name=_('Tenant')),
|
||||||
FieldSet('contact', 'contact_role', 'contact_group', name=_('Contacts')),
|
FieldSet('contact', 'contact_role', 'contact_group', name=_('Contacts')),
|
||||||
|
|||||||
@@ -21,6 +21,10 @@ __all__ = (
|
|||||||
|
|
||||||
class WirelessLANGroupFilterForm(NetBoxModelFilterSetForm):
|
class WirelessLANGroupFilterForm(NetBoxModelFilterSetForm):
|
||||||
model = WirelessLANGroup
|
model = WirelessLANGroup
|
||||||
|
fieldsets = (
|
||||||
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
|
FieldSet('parent_id', name=_('Wireless LAN group')),
|
||||||
|
)
|
||||||
parent_id = DynamicModelMultipleChoiceField(
|
parent_id = DynamicModelMultipleChoiceField(
|
||||||
queryset=WirelessLANGroup.objects.all(),
|
queryset=WirelessLANGroup.objects.all(),
|
||||||
required=False,
|
required=False,
|
||||||
@@ -32,7 +36,7 @@ class WirelessLANGroupFilterForm(NetBoxModelFilterSetForm):
|
|||||||
class WirelessLANFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
class WirelessLANFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
||||||
model = WirelessLAN
|
model = WirelessLAN
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('ssid', 'group_id', 'status', name=_('Attributes')),
|
FieldSet('ssid', 'group_id', 'status', name=_('Attributes')),
|
||||||
FieldSet('region_id', 'site_group_id', 'site_id', 'location_id', name=_('Scope')),
|
FieldSet('region_id', 'site_group_id', 'site_id', 'location_id', name=_('Scope')),
|
||||||
FieldSet('tenant_group_id', 'tenant_id', name=_('Tenant')),
|
FieldSet('tenant_group_id', 'tenant_id', name=_('Tenant')),
|
||||||
@@ -98,7 +102,7 @@ class WirelessLANFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
|||||||
class WirelessLinkFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
class WirelessLinkFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
||||||
model = WirelessLink
|
model = WirelessLink
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag', 'owner_id'),
|
||||||
FieldSet('ssid', 'status', 'distance', 'distance_unit', name=_('Attributes')),
|
FieldSet('ssid', 'status', 'distance', 'distance_unit', name=_('Attributes')),
|
||||||
FieldSet('tenant_group_id', 'tenant_id', name=_('Tenant')),
|
FieldSet('tenant_group_id', 'tenant_id', name=_('Tenant')),
|
||||||
FieldSet('auth_type', 'auth_cipher', 'auth_psk', name=_('Authentication')),
|
FieldSet('auth_type', 'auth_cipher', 'auth_psk', name=_('Authentication')),
|
||||||
|
|||||||
Reference in New Issue
Block a user