mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-25 08:46:10 -06:00
6347 move trackingmixin to specific models
This commit is contained in:
parent
b9a92a7723
commit
a7e142a2e4
@ -22,6 +22,7 @@ from netbox.config import ConfigItem
|
|||||||
from netbox.models import OrganizationalModel, PrimaryModel
|
from netbox.models import OrganizationalModel, PrimaryModel
|
||||||
from utilities.choices import ColorChoices
|
from utilities.choices import ColorChoices
|
||||||
from utilities.fields import ColorField, CounterCacheField, NaturalOrderingField
|
from utilities.fields import ColorField, CounterCacheField, NaturalOrderingField
|
||||||
|
from utilities.mixins import TrackingModelMixin
|
||||||
from .device_components import *
|
from .device_components import *
|
||||||
from .mixins import WeightMixin
|
from .mixins import WeightMixin
|
||||||
|
|
||||||
@ -469,7 +470,7 @@ def update_interface_bridges(device, interface_templates, module=None):
|
|||||||
interface.save()
|
interface.save()
|
||||||
|
|
||||||
|
|
||||||
class Device(PrimaryModel, ConfigContextModel):
|
class Device(PrimaryModel, ConfigContextModel, TrackingModelMixin):
|
||||||
"""
|
"""
|
||||||
A Device represents a piece of physical hardware mounted within a Rack. Each Device is assigned a DeviceType,
|
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.
|
DeviceRole, and (optionally) a Platform. Device names are not required, however if one is set it must be unique.
|
||||||
|
@ -7,7 +7,6 @@ from mptt.models import MPTTModel, TreeForeignKey
|
|||||||
from netbox.models.features import *
|
from netbox.models.features import *
|
||||||
from utilities.mptt import TreeManager
|
from utilities.mptt import TreeManager
|
||||||
from utilities.querysets import RestrictedQuerySet
|
from utilities.querysets import RestrictedQuerySet
|
||||||
from utilities.mixins import TrackingModelMixin
|
|
||||||
|
|
||||||
|
|
||||||
__all__ = (
|
__all__ = (
|
||||||
@ -28,7 +27,6 @@ class NetBoxFeatureSet(
|
|||||||
ExportTemplatesMixin,
|
ExportTemplatesMixin,
|
||||||
JournalingMixin,
|
JournalingMixin,
|
||||||
TagsMixin,
|
TagsMixin,
|
||||||
TrackingModelMixin,
|
|
||||||
WebhooksMixin
|
WebhooksMixin
|
||||||
):
|
):
|
||||||
class Meta:
|
class Meta:
|
||||||
|
@ -12,6 +12,7 @@ from extras.querysets import ConfigContextModelQuerySet
|
|||||||
from netbox.config import get_config
|
from netbox.config import get_config
|
||||||
from netbox.models import NetBoxModel, PrimaryModel
|
from netbox.models import NetBoxModel, PrimaryModel
|
||||||
from utilities.fields import CounterCacheField, NaturalOrderingField
|
from utilities.fields import CounterCacheField, NaturalOrderingField
|
||||||
|
from utilities.mixins import TrackingModelMixin
|
||||||
from utilities.ordering import naturalize_interface
|
from utilities.ordering import naturalize_interface
|
||||||
from utilities.query_functions import CollateAsChar
|
from utilities.query_functions import CollateAsChar
|
||||||
from virtualization.choices import *
|
from virtualization.choices import *
|
||||||
@ -22,7 +23,7 @@ __all__ = (
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class VirtualMachine(PrimaryModel, ConfigContextModel):
|
class VirtualMachine(PrimaryModel, ConfigContextModel, TrackingModelMixin):
|
||||||
"""
|
"""
|
||||||
A virtual machine which runs inside a Cluster.
|
A virtual machine which runs inside a Cluster.
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user