From 62269ec957e95f4ba88035b19ca741e1ab778848 Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Sat, 6 Apr 2019 19:25:34 +0200 Subject: [PATCH] Add ordering for levels --- manuels/migrations/0030_auto_20190406_1912.py | 18 ++++++++++++++++++ manuels/models.py | 2 ++ 2 files changed, 20 insertions(+) create mode 100644 manuels/migrations/0030_auto_20190406_1912.py diff --git a/manuels/migrations/0030_auto_20190406_1912.py b/manuels/migrations/0030_auto_20190406_1912.py new file mode 100644 index 0000000..b2cd359 --- /dev/null +++ b/manuels/migrations/0030_auto_20190406_1912.py @@ -0,0 +1,18 @@ +# Generated by Django 2.2 on 2019-04-06 17:12 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('manuels', '0029_auto_20190406_1904'), + ] + + operations = [ + migrations.RenameField( + model_name='suppliesrequirement', + old_name='fields', + new_name='field', + ), + ] diff --git a/manuels/models.py b/manuels/models.py index 26f14ff..d8a6644 100644 --- a/manuels/models.py +++ b/manuels/models.py @@ -106,8 +106,10 @@ class Level(BaseModel): class Meta: verbose_name = 'classe' verbose_name_plural = 'classes' + ordering = ['order', 'name'] name = models.CharField('nom', max_length=50) + order = models.IntegerField('ordre', default=0) def __str__(self): return self.name