17058 RackType name -> model (#17059)

* 17058 RackType name -> model

* 17058 RackType name -> model

* 17058 fix tests

* 17058 fix tests
This commit is contained in:
Arthur Hanson
2024-08-01 20:06:51 +07:00
committed by GitHub
parent c51e91dddd
commit d6f2fc7d29
15 changed files with 74 additions and 59 deletions

View File

@@ -37,14 +37,7 @@ class Migration(migrations.Migration):
related_name='rack_types',
to='dcim.manufacturer'
)),
('name', models.CharField(max_length=100)),
('_name', utilities.fields.NaturalOrderingField(
'name',
blank=True,
max_length=100,
naturalize_function=utilities.ordering.naturalize
),
),
('model', models.CharField(max_length=100)),
('slug', models.SlugField(max_length=100, unique=True)),
('form_factor', models.CharField(blank=True, max_length=50)),
('width', models.PositiveSmallIntegerField(default=19)),
@@ -71,7 +64,7 @@ class Migration(migrations.Migration):
options={
'verbose_name': 'racktype',
'verbose_name_plural': 'racktypes',
'ordering': ('_name', 'pk'),
'ordering': ('manufacturer', 'model'),
},
),
migrations.RenameField(
@@ -90,4 +83,16 @@ class Migration(migrations.Migration):
to='dcim.racktype',
),
),
migrations.AddConstraint(
model_name='racktype',
constraint=models.UniqueConstraint(
fields=('manufacturer', 'model'), name='dcim_racktype_unique_manufacturer_model'
),
),
migrations.AddConstraint(
model_name='racktype',
constraint=models.UniqueConstraint(
fields=('manufacturer', 'slug'), name='dcim_racktype_unique_manufacturer_slug'
),
),
]