mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Code formatting cleanup
This commit is contained in:
@ -8,7 +8,7 @@ from django.urls import reverse
|
||||
from django.utils.encoding import python_2_unicode_compatible
|
||||
|
||||
from dcim.models import Device
|
||||
from extras.models import CustomFieldModel, CustomFieldValue
|
||||
from extras.models import CustomFieldModel
|
||||
from utilities.models import CreatedUpdatedModel
|
||||
from .constants import DEVICE_STATUS_ACTIVE, VM_STATUS_CHOICES, VM_STATUS_CLASSES
|
||||
|
||||
@ -119,7 +119,7 @@ class Cluster(CreatedUpdatedModel, CustomFieldModel):
|
||||
blank=True
|
||||
)
|
||||
custom_field_values = GenericRelation(
|
||||
to=CustomFieldValue,
|
||||
to='extras.CustomFieldValue',
|
||||
content_type_field='obj_type',
|
||||
object_id_field='obj_id'
|
||||
)
|
||||
@ -167,7 +167,7 @@ class VirtualMachine(CreatedUpdatedModel, CustomFieldModel):
|
||||
A virtual machine which runs inside a Cluster.
|
||||
"""
|
||||
cluster = models.ForeignKey(
|
||||
to=Cluster,
|
||||
to='virtualization.Cluster',
|
||||
on_delete=models.PROTECT,
|
||||
related_name='virtual_machines'
|
||||
)
|
||||
@ -196,9 +196,9 @@ class VirtualMachine(CreatedUpdatedModel, CustomFieldModel):
|
||||
)
|
||||
role = models.ForeignKey(
|
||||
to='dcim.DeviceRole',
|
||||
limit_choices_to={'vm_role': True},
|
||||
on_delete=models.PROTECT,
|
||||
related_name='virtual_machines',
|
||||
limit_choices_to={'vm_role': True},
|
||||
blank=True,
|
||||
null=True
|
||||
)
|
||||
@ -237,7 +237,7 @@ class VirtualMachine(CreatedUpdatedModel, CustomFieldModel):
|
||||
blank=True
|
||||
)
|
||||
custom_field_values = GenericRelation(
|
||||
to=CustomFieldValue,
|
||||
to='extras.CustomFieldValue',
|
||||
content_type_field='obj_type',
|
||||
object_id_field='obj_id'
|
||||
)
|
||||
|
Reference in New Issue
Block a user