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:
@@ -14,7 +14,7 @@ from dcim.constants import *
|
||||
from extras.models import ConfigContextModel
|
||||
from extras.querysets import ConfigContextModelQuerySet
|
||||
from netbox.config import ConfigItem
|
||||
from netbox.models import OrganizationalModel, PrimaryModel
|
||||
from netbox.models import OrganizationalModel, NetBoxModel
|
||||
from utilities.choices import ColorChoices
|
||||
from utilities.fields import ColorField, NaturalOrderingField
|
||||
from .device_components import *
|
||||
@@ -68,7 +68,7 @@ class Manufacturer(OrganizationalModel):
|
||||
return reverse('dcim:manufacturer', args=[self.pk])
|
||||
|
||||
|
||||
class DeviceType(PrimaryModel):
|
||||
class DeviceType(NetBoxModel):
|
||||
"""
|
||||
A DeviceType represents a particular make (Manufacturer) and model of device. It specifies rack height and depth, as
|
||||
well as high-level functional role(s).
|
||||
@@ -350,7 +350,7 @@ class DeviceType(PrimaryModel):
|
||||
return self.subdevice_role == SubdeviceRoleChoices.ROLE_CHILD
|
||||
|
||||
|
||||
class ModuleType(PrimaryModel):
|
||||
class ModuleType(NetBoxModel):
|
||||
"""
|
||||
A ModuleType represents a hardware element that can be installed within a device and which houses additional
|
||||
components; for example, a line card within a chassis-based switch such as the Cisco Catalyst 6500. Like a
|
||||
@@ -569,7 +569,7 @@ class Platform(OrganizationalModel):
|
||||
return reverse('dcim:platform', args=[self.pk])
|
||||
|
||||
|
||||
class Device(PrimaryModel, ConfigContextModel):
|
||||
class Device(NetBoxModel, ConfigContextModel):
|
||||
"""
|
||||
A Device represents a piece of physical hardware mounted within a Rack. Each Device is assigned a DeviceType,
|
||||
DeviceRole, and (optionally) a Platform. Device names are not required, however if one is set it must be unique.
|
||||
@@ -1005,7 +1005,7 @@ class Device(PrimaryModel, ConfigContextModel):
|
||||
return DeviceStatusChoices.colors.get(self.status, 'secondary')
|
||||
|
||||
|
||||
class Module(PrimaryModel, ConfigContextModel):
|
||||
class Module(NetBoxModel, ConfigContextModel):
|
||||
"""
|
||||
A Module represents a field-installable component within a Device which may itself hold multiple device components
|
||||
(for example, a line card within a chassis switch). Modules are instantiated from ModuleTypes.
|
||||
@@ -1087,7 +1087,7 @@ class Module(PrimaryModel, ConfigContextModel):
|
||||
# Virtual chassis
|
||||
#
|
||||
|
||||
class VirtualChassis(PrimaryModel):
|
||||
class VirtualChassis(NetBoxModel):
|
||||
"""
|
||||
A collection of Devices which operate with a shared control plane (e.g. a switch stack).
|
||||
"""
|
||||
|
Reference in New Issue
Block a user