1
0
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:
Jeremy Stretch
2018-03-30 13:57:26 -04:00
parent 0bb632c642
commit 9725f19bae
8 changed files with 1252 additions and 333 deletions

View File

@ -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'
)