mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Rename PrimaryModel to NetBoxModel
This commit is contained in:
@@ -9,7 +9,7 @@ from django.utils.functional import cached_property
|
||||
|
||||
from dcim.fields import ASNField
|
||||
from dcim.models import Device
|
||||
from netbox.models import OrganizationalModel, PrimaryModel
|
||||
from netbox.models import OrganizationalModel, NetBoxModel
|
||||
from ipam.choices import *
|
||||
from ipam.constants import *
|
||||
from ipam.fields import IPNetworkField, IPAddressField
|
||||
@@ -88,7 +88,7 @@ class RIR(OrganizationalModel):
|
||||
return reverse('ipam:rir', args=[self.pk])
|
||||
|
||||
|
||||
class ASN(PrimaryModel):
|
||||
class ASN(NetBoxModel):
|
||||
"""
|
||||
An autonomous system (AS) number is typically used to represent an independent routing domain. A site can have
|
||||
one or more ASNs assigned to it.
|
||||
@@ -147,7 +147,7 @@ class ASN(PrimaryModel):
|
||||
return self.asn
|
||||
|
||||
|
||||
class Aggregate(GetAvailablePrefixesMixin, PrimaryModel):
|
||||
class Aggregate(GetAvailablePrefixesMixin, NetBoxModel):
|
||||
"""
|
||||
An aggregate exists at the root level of the IP address space hierarchy in NetBox. Aggregates are used to organize
|
||||
the hierarchy and track the overall utilization of available address space. Each Aggregate is assigned to a RIR.
|
||||
@@ -280,7 +280,7 @@ class Role(OrganizationalModel):
|
||||
return reverse('ipam:role', args=[self.pk])
|
||||
|
||||
|
||||
class Prefix(GetAvailablePrefixesMixin, PrimaryModel):
|
||||
class Prefix(GetAvailablePrefixesMixin, NetBoxModel):
|
||||
"""
|
||||
A Prefix represents an IPv4 or IPv6 network, including mask length. Prefixes can optionally be assigned to Sites and
|
||||
VRFs. A Prefix must be assigned a status and may optionally be assigned a used-define Role. A Prefix can also be
|
||||
@@ -557,7 +557,7 @@ class Prefix(GetAvailablePrefixesMixin, PrimaryModel):
|
||||
return min(utilization, 100)
|
||||
|
||||
|
||||
class IPRange(PrimaryModel):
|
||||
class IPRange(NetBoxModel):
|
||||
"""
|
||||
A range of IP addresses, defined by start and end addresses.
|
||||
"""
|
||||
@@ -752,7 +752,7 @@ class IPRange(PrimaryModel):
|
||||
return int(float(child_count) / self.size * 100)
|
||||
|
||||
|
||||
class IPAddress(PrimaryModel):
|
||||
class IPAddress(NetBoxModel):
|
||||
"""
|
||||
An IPAddress represents an individual IPv4 or IPv6 address and its mask. The mask length should match what is
|
||||
configured in the real world. (Typically, only loopback interfaces are configured with /32 or /128 masks.) Like
|
||||
|
Reference in New Issue
Block a user