Add label to *ports models

This commit is contained in:
Jonathan Senecal 2020-06-05 10:32:59 -04:00
parent f8851121ab
commit a06d74472d
3 changed files with 93 additions and 0 deletions

View File

@ -0,0 +1,53 @@
# Generated by Django 3.0.7 on 2020-06-05 14:32
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('dcim', '0107_interface_label'),
]
operations = [
migrations.AddField(
model_name='consoleport',
name='label',
field=models.CharField(blank=True, max_length=64),
),
migrations.AddField(
model_name='consoleporttemplate',
name='label',
field=models.CharField(blank=True, max_length=64),
),
migrations.AddField(
model_name='consoleserverport',
name='label',
field=models.CharField(blank=True, max_length=64),
),
migrations.AddField(
model_name='consoleserverporttemplate',
name='label',
field=models.CharField(blank=True, max_length=64),
),
migrations.AddField(
model_name='poweroutlet',
name='label',
field=models.CharField(blank=True, max_length=64),
),
migrations.AddField(
model_name='poweroutlettemplate',
name='label',
field=models.CharField(blank=True, max_length=64),
),
migrations.AddField(
model_name='powerport',
name='label',
field=models.CharField(blank=True, max_length=64),
),
migrations.AddField(
model_name='powerporttemplate',
name='label',
field=models.CharField(blank=True, max_length=64),
),
]

View File

@ -69,6 +69,11 @@ class ConsolePortTemplate(ComponentTemplateModel):
max_length=100,
blank=True
)
label = models.CharField(
max_length=64,
blank=True,
help_text="The physical label for this console port"
)
type = models.CharField(
max_length=50,
choices=ConsolePortTypeChoices,
@ -107,6 +112,11 @@ class ConsoleServerPortTemplate(ComponentTemplateModel):
max_length=100,
blank=True
)
label = models.CharField(
max_length=64,
blank=True,
help_text="The physical label for this console server port"
)
type = models.CharField(
max_length=50,
choices=ConsolePortTypeChoices,
@ -145,6 +155,11 @@ class PowerPortTemplate(ComponentTemplateModel):
max_length=100,
blank=True
)
label = models.CharField(
max_length=64,
blank=True,
help_text="The physical label for this power supply port"
)
type = models.CharField(
max_length=50,
choices=PowerPortTypeChoices,
@ -197,6 +212,11 @@ class PowerOutletTemplate(ComponentTemplateModel):
max_length=100,
blank=True
)
label = models.CharField(
max_length=64,
blank=True,
help_text="The physical label for this power outlet"
)
type = models.CharField(
max_length=50,
choices=PowerOutletTypeChoices,

View File

@ -231,6 +231,11 @@ class ConsolePort(CableTermination, ComponentModel):
name = models.CharField(
max_length=50
)
label = models.CharField(
max_length=64,
blank=True,
help_text="The physical label for this console port"
)
_name = NaturalOrderingField(
target_field='name',
max_length=100,
@ -298,6 +303,11 @@ class ConsoleServerPort(CableTermination, ComponentModel):
max_length=100,
blank=True
)
label = models.CharField(
max_length=64,
blank=True,
help_text="The physical label for this console server port"
)
type = models.CharField(
max_length=50,
choices=ConsolePortTypeChoices,
@ -353,6 +363,11 @@ class PowerPort(CableTermination, ComponentModel):
max_length=100,
blank=True
)
label = models.CharField(
max_length=64,
blank=True,
help_text="The physical label for this power supply port"
)
type = models.CharField(
max_length=50,
choices=PowerPortTypeChoices,
@ -516,6 +531,11 @@ class PowerOutlet(CableTermination, ComponentModel):
max_length=100,
blank=True
)
label = models.CharField(
max_length=64,
blank=True,
help_text="The physical label for this power outlet"
)
type = models.CharField(
max_length=50,
choices=PowerOutletTypeChoices,