From 9889e9ee500098bfd051c85de869a17a95714d03 Mon Sep 17 00:00:00 2001 From: Med Date: Tue, 4 Jul 2017 22:29:11 +0200 Subject: [PATCH] Supprime les doublons --- media/migrations/0008_auto_20170704_2047.py | 25 +++++++++++++++++++++ media/models.py | 3 ++- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 media/migrations/0008_auto_20170704_2047.py diff --git a/media/migrations/0008_auto_20170704_2047.py b/media/migrations/0008_auto_20170704_2047.py new file mode 100644 index 0000000..635ecca --- /dev/null +++ b/media/migrations/0008_auto_20170704_2047.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.2 on 2017-07-04 18:47 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('media', '0007_auto_20170704_0138'), + ] + + operations = [ + migrations.AlterField( + model_name='auteur', + name='nom', + field=models.CharField(max_length=255, unique=True), + ), + migrations.AlterField( + model_name='jeu', + name='duree', + field=models.CharField(choices=[('-1h', '-1h'), ('1-2h', '1-2h'), ('2-3h', '2-3h'), ('3-4h', '3-4h'), ('4h+', '4h+')], max_length=255), + ), + ] diff --git a/media/models.py b/media/models.py index 5fdd9ec..4d8f6ff 100644 --- a/media/models.py +++ b/media/models.py @@ -2,7 +2,7 @@ from django.db import models from django.core.validators import MinValueValidator class Auteur(models.Model): - nom = models.CharField(max_length=255) + nom = models.CharField(max_length=255, unique=True) def __str__(self): return self.nom @@ -30,6 +30,7 @@ class Jeu(models.Model): ('-1h', '-1h'), ('1-2h', '1-2h'), ('2-3h', '2-3h'), + ('3-4h', '3-4h'), ('4h+', '4h+'), )