mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
* Move ASN to a separate module * Move ASNField from dcim to ipam * Introduce ASNRange model * Add relationship from ASN to ASNRange * Add an available-asns API endpoint * Add RIR assignment for ASNRange * Add standard tests * Move child ASNs to a tabbed view * Remove FK on ASN to ASNRange * Add tests for provisioning available ASNs * Add docs for ASNRange
This commit is contained in:
@@ -16,6 +16,7 @@ from utilities.forms import (
|
||||
__all__ = (
|
||||
'AggregateBulkEditForm',
|
||||
'ASNBulkEditForm',
|
||||
'ASNRangeBulkEditForm',
|
||||
'FHRPGroupBulkEditForm',
|
||||
'IPAddressBulkEditForm',
|
||||
'IPRangeBulkEditForm',
|
||||
@@ -97,6 +98,28 @@ class RIRBulkEditForm(NetBoxModelBulkEditForm):
|
||||
nullable_fields = ('is_private', 'description')
|
||||
|
||||
|
||||
class ASNRangeBulkEditForm(NetBoxModelBulkEditForm):
|
||||
rir = DynamicModelChoiceField(
|
||||
queryset=RIR.objects.all(),
|
||||
required=False,
|
||||
label=_('RIR')
|
||||
)
|
||||
tenant = DynamicModelChoiceField(
|
||||
queryset=Tenant.objects.all(),
|
||||
required=False
|
||||
)
|
||||
description = forms.CharField(
|
||||
max_length=200,
|
||||
required=False
|
||||
)
|
||||
|
||||
model = ASNRange
|
||||
fieldsets = (
|
||||
(None, ('rir', 'tenant', 'description')),
|
||||
)
|
||||
nullable_fields = ('description',)
|
||||
|
||||
|
||||
class ASNBulkEditForm(NetBoxModelBulkEditForm):
|
||||
sites = DynamicModelMultipleChoiceField(
|
||||
queryset=Site.objects.all(),
|
||||
@@ -124,7 +147,7 @@ class ASNBulkEditForm(NetBoxModelBulkEditForm):
|
||||
fieldsets = (
|
||||
(None, ('sites', 'rir', 'tenant', 'description')),
|
||||
)
|
||||
nullable_fields = ('date_added', 'description', 'comments')
|
||||
nullable_fields = ('tenant', 'description', 'comments')
|
||||
|
||||
|
||||
class AggregateBulkEditForm(NetBoxModelBulkEditForm):
|
||||
|
Reference in New Issue
Block a user