Skip to content

Commit c2d1988

Browse files
Closes #14035: Order global search results of equivalent weight by value (#14140)
1 parent 77208bf commit c2d1988

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 4.2.6 on 2023-10-30 14:04
2+
3+
from django.db import migrations
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('extras', '0098_webhook_custom_field_data_webhook_tags'),
10+
]
11+
12+
operations = [
13+
migrations.AlterModelOptions(
14+
name='cachedvalue',
15+
options={'ordering': ('weight', 'object_type', 'value', 'object_id')},
16+
),
17+
]

netbox/extras/models/search.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class CachedValue(models.Model):
5050
)
5151

5252
class Meta:
53-
ordering = ('weight', 'object_type', 'object_id')
53+
ordering = ('weight', 'object_type', 'value', 'object_id')
5454
verbose_name = _('cached value')
5555
verbose_name_plural = _('cached values')
5656

0 commit comments

Comments
 (0)