Bläddra i källkod

Normalize ordering of cables by PK

Jeremy Stretch 7 år sedan
förälder
incheckning
cf9c8f35a0
2 ändrade filer med 2 tillägg och 0 borttagningar
  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'),