Skip to content

Commit

Permalink
Closes #14035: Order global search results of equivalent weight by va…
Browse files Browse the repository at this point in the history
…lue (#14140)
  • Loading branch information
jeremystretch authored Nov 1, 2023
1 parent 77208bf commit c2d1988
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions netbox/extras/migrations/0099_cachedvalue_ordering.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 4.2.6 on 2023-10-30 14:04

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('extras', '0098_webhook_custom_field_data_webhook_tags'),
]

operations = [
migrations.AlterModelOptions(
name='cachedvalue',
options={'ordering': ('weight', 'object_type', 'value', 'object_id')},
),
]
2 changes: 1 addition & 1 deletion netbox/extras/models/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class CachedValue(models.Model):
)

class Meta:
ordering = ('weight', 'object_type', 'object_id')
ordering = ('weight', 'object_type', 'value', 'object_id')
verbose_name = _('cached value')
verbose_name_plural = _('cached values')

Expand Down

0 comments on commit c2d1988

Please sign in to comment.