Correction: empêcher d'ajouter 2 fois le même objet à la même collection
This commit is contained in:
parent
083d10fc6e
commit
4dfe7f4285
@ -48,6 +48,8 @@ class Item(models.Model):
|
|||||||
default=cls.DEFAULT_CHOICE,
|
default=cls.DEFAULT_CHOICE,
|
||||||
verbose_name=_('status'))
|
verbose_name=_('status'))
|
||||||
status_field.contribute_to_class(cls, '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:
|
class Meta:
|
||||||
abstract = True
|
abstract = True
|
||||||
|
Loading…
Reference in New Issue
Block a user