|
@@ -21,6 +21,7 @@ from dcim.fields import MACAddressField
|
|
|
from dcim.utils import create_port_mappings, update_interface_bridges
|
|
from dcim.utils import create_port_mappings, update_interface_bridges
|
|
|
from extras.models import ConfigContextModel, CustomField
|
|
from extras.models import ConfigContextModel, CustomField
|
|
|
from extras.querysets import ConfigContextModelQuerySet
|
|
from extras.querysets import ConfigContextModelQuerySet
|
|
|
|
|
+from ipam.fields import IPAddressField
|
|
|
from netbox.choices import ColorChoices
|
|
from netbox.choices import ColorChoices
|
|
|
from netbox.config import ConfigItem
|
|
from netbox.config import ConfigItem
|
|
|
from netbox.models import NestedGroupModel, OrganizationalModel, PrimaryModel
|
|
from netbox.models import NestedGroupModel, OrganizationalModel, PrimaryModel
|
|
@@ -673,6 +674,19 @@ class Device(
|
|
|
related_query_name='device',
|
|
related_query_name='device',
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
|
|
+ # Denormalized fields
|
|
|
|
|
+ _virtual_chassis_name = models.CharField(
|
|
|
|
|
+ blank=True,
|
|
|
|
|
+ )
|
|
|
|
|
+ _primary_ip4_address = IPAddressField(
|
|
|
|
|
+ blank=True,
|
|
|
|
|
+ null=True,
|
|
|
|
|
+ )
|
|
|
|
|
+ _primary_ip6_address = IPAddressField(
|
|
|
|
|
+ blank=True,
|
|
|
|
|
+ null=True,
|
|
|
|
|
+ )
|
|
|
|
|
+
|
|
|
# Counter fields
|
|
# Counter fields
|
|
|
console_port_count = CounterCacheField(
|
|
console_port_count = CounterCacheField(
|
|
|
to_model='dcim.ConsolePort',
|
|
to_model='dcim.ConsolePort',
|