Modèle settings

- Ajout de l'unicité du nom d'un paramètre

Ce qui a pour conséquence de rajouter un index sur le nom, ce qui est
bien
This commit is contained in:
Aurélien Delobelle 2016-08-07 18:41:09 +02:00
parent 346cbb2695
commit 515a7ce28e
2 changed files with 22 additions and 1 deletions

View file

@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('kfet', '0012_settings'),
]
operations = [
migrations.AlterField(
model_name='settings',
name='name',
field=models.CharField(unique=True, max_length=45),
),
]

View file

@ -418,7 +418,9 @@ class GlobalPermissions(models.Model):
)
class Settings(models.Model):
name = models.CharField(max_length = 45)
name = models.CharField(
max_length = 45,
unique = True)
value_decimal = models.DecimalField(
max_digits = 6, decimal_places = 2,
blank = True, null = True, default = None)