From 4dfe7f4285dff28e36eb0763491bab6aaaab5218 Mon Sep 17 00:00:00 2001 From: Olivier DOSSMANN Date: Thu, 18 Jan 2018 20:31:09 +0100 Subject: [PATCH] =?UTF-8?q?Correction:=20emp=C3=AAcher=20d'ajouter=202=20f?= =?UTF-8?q?ois=20le=20m=C3=AAme=20objet=20=C3=A0=20la=20m=C3=AAme=20collec?= =?UTF-8?q?tion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- collection/core/models.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/collection/core/models.py b/collection/core/models.py index 8490e95..24ca680 100644 --- a/collection/core/models.py +++ b/collection/core/models.py @@ -48,6 +48,8 @@ class Item(models.Model): default=cls.DEFAULT_CHOICE, verbose_name=_('status')) status_field.contribute_to_class(cls, 'status') + # check that no other same item name on same collection exists + cls._meta.unique_together = (('collection', 'name'), ) class Meta: abstract = True