Browse Source

fix(assets): model 添加 asset 默认排序

pull/5029/head
xinwen 4 years ago committed by Jiangjie.Bai
parent
commit
f557c1dace
  1. 17
      apps/assets/migrations/0062_auto_20201117_1938.py
  2. 2
      apps/assets/models/asset.py

17
apps/assets/migrations/0062_auto_20201117_1938.py

@ -0,0 +1,17 @@
# Generated by Django 2.2.13 on 2020-11-17 11:38
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('assets', '0061_auto_20201116_1757'),
]
operations = [
migrations.AlterModelOptions(
name='asset',
options={'ordering': ['hostname', 'ip'], 'verbose_name': 'Asset'},
),
]

2
apps/assets/models/asset.py

@ -361,4 +361,4 @@ class Asset(ProtocolsMixin, NodesRelationMixin, OrgModelMixin):
class Meta:
unique_together = [('org_id', 'hostname')]
verbose_name = _("Asset")
ordering = ['-date_created']
ordering = ["hostname", "ip"]

Loading…
Cancel
Save