Add ordering for levels

This commit is contained in:
Gabriel Augendre 2019-04-06 19:25:34 +02:00
parent fd8af82a71
commit 62269ec957
2 changed files with 20 additions and 0 deletions

View file

@ -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',
),
]

View file

@ -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