Add ordering for levels
This commit is contained in:
parent
fd8af82a71
commit
62269ec957
2 changed files with 20 additions and 0 deletions
18
manuels/migrations/0030_auto_20190406_1912.py
Normal file
18
manuels/migrations/0030_auto_20190406_1912.py
Normal 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',
|
||||||
|
),
|
||||||
|
]
|
|
@ -106,8 +106,10 @@ class Level(BaseModel):
|
||||||
class Meta:
|
class Meta:
|
||||||
verbose_name = 'classe'
|
verbose_name = 'classe'
|
||||||
verbose_name_plural = 'classes'
|
verbose_name_plural = 'classes'
|
||||||
|
ordering = ['order', 'name']
|
||||||
|
|
||||||
name = models.CharField('nom', max_length=50)
|
name = models.CharField('nom', max_length=50)
|
||||||
|
order = models.IntegerField('ordre', default=0)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.name
|
return self.name
|
||||||
|
|
Loading…
Reference in a new issue