Skip to content

Commit 4d2617f

Browse files
committed
Fixes netbox-community#2562 netbox-community#1073 - Reorders Prefix Ordering to allow allow for proper matching of heirarchy for IP address space
1 parent 7dde370 commit 4d2617f

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Generated by Django 2.1.3 on 2018-11-16 21:22
2+
3+
from django.db import migrations
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('ipam', '0023_change_logging'),
10+
]
11+
12+
operations = [
13+
migrations.AlterModelOptions(
14+
name='prefix',
15+
options={'ordering': ['family', 'prefix', 'vrf'], 'verbose_name_plural': 'prefixes'},
16+
),
17+
]

netbox/ipam/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ class Prefix(ChangeLoggedModel, CustomFieldModel):
329329
]
330330

331331
class Meta:
332-
ordering = ['vrf', 'family', 'prefix']
332+
ordering = ['family', 'prefix', 'vrf']
333333
verbose_name_plural = 'prefixes'
334334

335335
def __str__(self):

0 commit comments

Comments
 (0)