From f557c1dace22dc51dce58a97d77f265fdfb084bd Mon Sep 17 00:00:00 2001 From: xinwen Date: Tue, 17 Nov 2020 19:30:10 +0800 Subject: [PATCH] =?UTF-8?q?fix(assets):=20model=20=E6=B7=BB=E5=8A=A0=20ass?= =?UTF-8?q?et=20=E9=BB=98=E8=AE=A4=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../migrations/0062_auto_20201117_1938.py | 17 +++++++++++++++++ apps/assets/models/asset.py | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 apps/assets/migrations/0062_auto_20201117_1938.py diff --git a/apps/assets/migrations/0062_auto_20201117_1938.py b/apps/assets/migrations/0062_auto_20201117_1938.py new file mode 100644 index 000000000..9764ede39 --- /dev/null +++ b/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'}, + ), + ] diff --git a/apps/assets/models/asset.py b/apps/assets/models/asset.py index 4e3fff60f..d4c787bbc 100644 --- a/apps/assets/models/asset.py +++ b/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"]