mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-31 12:56:24 -06:00
11279 add collation
This commit is contained in:
parent
03d413565f
commit
4062986e06
19
netbox/dcim/migrations/0197_auto_20241112_2221.py
Normal file
19
netbox/dcim/migrations/0197_auto_20241112_2221.py
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
# Generated by Django 5.0.9 on 2024-11-12 22:21
|
||||||
|
|
||||||
|
from django.contrib.postgres.operations import CreateCollation
|
||||||
|
from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('dcim', '0196_qinq_svlan'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
CreateCollation(
|
||||||
|
"natural_sort",
|
||||||
|
provider="icu",
|
||||||
|
locale="und-u-kn-true",
|
||||||
|
),
|
||||||
|
]
|
@ -0,0 +1,22 @@
|
|||||||
|
# Generated by Django 5.0.9 on 2024-11-12 22:26
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('dcim', '0197_auto_20241112_2221'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterModelOptions(
|
||||||
|
name='site',
|
||||||
|
options={'ordering': ('name',)},
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='site',
|
||||||
|
name='name',
|
||||||
|
field=models.CharField(db_collation='natural_sort', max_length=100, unique=True),
|
||||||
|
),
|
||||||
|
]
|
@ -143,7 +143,8 @@ class Site(ContactsMixin, ImageAttachmentsMixin, PrimaryModel):
|
|||||||
verbose_name=_('name'),
|
verbose_name=_('name'),
|
||||||
max_length=100,
|
max_length=100,
|
||||||
unique=True,
|
unique=True,
|
||||||
help_text=_("Full name of the site")
|
help_text=_("Full name of the site"),
|
||||||
|
db_collation="natural_sort"
|
||||||
)
|
)
|
||||||
_name = NaturalOrderingField(
|
_name = NaturalOrderingField(
|
||||||
target_field='name',
|
target_field='name',
|
||||||
@ -245,7 +246,7 @@ class Site(ContactsMixin, ImageAttachmentsMixin, PrimaryModel):
|
|||||||
)
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
ordering = ('_name',)
|
ordering = ('name',)
|
||||||
verbose_name = _('site')
|
verbose_name = _('site')
|
||||||
verbose_name_plural = _('sites')
|
verbose_name_plural = _('sites')
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user