mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Renamed CreatedUpdatedModel to ChangeLoggedModel and applied it to all primary and organizational models
This commit is contained in:
55
netbox/virtualization/migrations/0007_change_logging.py
Normal file
55
netbox/virtualization/migrations/0007_change_logging.py
Normal file
@@ -0,0 +1,55 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.11.12 on 2018-06-13 17:14
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('virtualization', '0006_tags'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='clustergroup',
|
||||
name='created',
|
||||
field=models.DateField(auto_now_add=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='clustergroup',
|
||||
name='last_updated',
|
||||
field=models.DateTimeField(auto_now=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='clustertype',
|
||||
name='created',
|
||||
field=models.DateField(auto_now_add=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='clustertype',
|
||||
name='last_updated',
|
||||
field=models.DateTimeField(auto_now=True, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='cluster',
|
||||
name='created',
|
||||
field=models.DateField(auto_now_add=True, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='cluster',
|
||||
name='last_updated',
|
||||
field=models.DateTimeField(auto_now=True, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='virtualmachine',
|
||||
name='created',
|
||||
field=models.DateField(auto_now_add=True, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='virtualmachine',
|
||||
name='last_updated',
|
||||
field=models.DateTimeField(auto_now=True, null=True),
|
||||
),
|
||||
]
|
@@ -10,7 +10,7 @@ from taggit.managers import TaggableManager
|
||||
|
||||
from dcim.models import Device
|
||||
from extras.models import CustomFieldModel
|
||||
from utilities.models import CreatedUpdatedModel
|
||||
from utilities.models import ChangeLoggedModel
|
||||
from .constants import DEVICE_STATUS_ACTIVE, VM_STATUS_CHOICES, VM_STATUS_CLASSES
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ from .constants import DEVICE_STATUS_ACTIVE, VM_STATUS_CHOICES, VM_STATUS_CLASSE
|
||||
#
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class ClusterType(models.Model):
|
||||
class ClusterType(ChangeLoggedModel):
|
||||
"""
|
||||
A type of Cluster.
|
||||
"""
|
||||
@@ -31,6 +31,7 @@ class ClusterType(models.Model):
|
||||
unique=True
|
||||
)
|
||||
|
||||
serializer = 'virtualization.api.serializers.ClusterTypeSerializer'
|
||||
csv_headers = ['name', 'slug']
|
||||
|
||||
class Meta:
|
||||
@@ -54,7 +55,7 @@ class ClusterType(models.Model):
|
||||
#
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class ClusterGroup(models.Model):
|
||||
class ClusterGroup(ChangeLoggedModel):
|
||||
"""
|
||||
An organizational group of Clusters.
|
||||
"""
|
||||
@@ -66,9 +67,8 @@ class ClusterGroup(models.Model):
|
||||
unique=True
|
||||
)
|
||||
|
||||
csv_headers = ['name', 'slug']
|
||||
|
||||
serializer = 'virtualization.api.serializers.ClusterGroupSerializer'
|
||||
csv_headers = ['name', 'slug']
|
||||
|
||||
class Meta:
|
||||
ordering = ['name']
|
||||
@@ -91,7 +91,7 @@ class ClusterGroup(models.Model):
|
||||
#
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class Cluster(CreatedUpdatedModel, CustomFieldModel):
|
||||
class Cluster(ChangeLoggedModel, CustomFieldModel):
|
||||
"""
|
||||
A cluster of VirtualMachines. Each Cluster may optionally be associated with one or more Devices.
|
||||
"""
|
||||
@@ -129,9 +129,8 @@ class Cluster(CreatedUpdatedModel, CustomFieldModel):
|
||||
|
||||
tags = TaggableManager()
|
||||
|
||||
csv_headers = ['name', 'type', 'group', 'site', 'comments']
|
||||
|
||||
serializer = 'virtualization.api.serializers.ClusterSerializer'
|
||||
csv_headers = ['name', 'type', 'group', 'site', 'comments']
|
||||
|
||||
class Meta:
|
||||
ordering = ['name']
|
||||
@@ -169,7 +168,7 @@ class Cluster(CreatedUpdatedModel, CustomFieldModel):
|
||||
#
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class VirtualMachine(CreatedUpdatedModel, CustomFieldModel):
|
||||
class VirtualMachine(ChangeLoggedModel, CustomFieldModel):
|
||||
"""
|
||||
A virtual machine which runs inside a Cluster.
|
||||
"""
|
||||
@@ -251,12 +250,11 @@ class VirtualMachine(CreatedUpdatedModel, CustomFieldModel):
|
||||
|
||||
tags = TaggableManager()
|
||||
|
||||
serializer = 'virtualization.api.serializers.VirtualMachineSerializer'
|
||||
csv_headers = [
|
||||
'name', 'status', 'role', 'cluster', 'tenant', 'platform', 'vcpus', 'memory', 'disk', 'comments',
|
||||
]
|
||||
|
||||
serializer = 'virtualization.api.serializers.VirtualMachineSerializer'
|
||||
|
||||
class Meta:
|
||||
ordering = ['name']
|
||||
|
||||
|
Reference in New Issue
Block a user