Просмотр исходного кода

Normalize ordering of cables by PK

Jeremy Stretch 7 лет назад
Родитель
Сommit
cf9c8f35a0
2 измененных файлов с 2 добавлено и 0 удалено
  1. 1 0
      netbox/dcim/migrations/0066_cables.py
  2. 1 0
      netbox/dcim/models.py

+ 1 - 0
netbox/dcim/migrations/0066_cables.py

@@ -135,6 +135,7 @@ class Migration(migrations.Migration):
         # Create the Cable model
         migrations.CreateModel(
             name='Cable',
+            options={'ordering': ['pk']},
             fields=[
                 ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False)),
                 ('created', models.DateField(auto_now_add=True, null=True)),

+ 1 - 0
netbox/dcim/models.py

@@ -2443,6 +2443,7 @@ class Cable(ChangeLoggedModel):
     ]
 
     class Meta:
+        ordering = ['pk']
         unique_together = (
             ('termination_a_type', 'termination_a_id'),
             ('termination_b_type', 'termination_b_id'),