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