From: W. Trevor King Date: Mon, 2 Apr 2012 14:39:57 +0000 (-0400) Subject: Don't allow duplicate records for the same CAS number. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=290ceecf73524b3d6fa48b8a147c93e3e5243ba7;p=chemdb.git Don't allow duplicate records for the same CAS number. --- diff --git a/chemdb/models.py b/chemdb/models.py index 5ef57d1..02c1e54 100644 --- a/chemdb/models.py +++ b/chemdb/models.py @@ -33,7 +33,7 @@ class NFPASpecial (NamedItem): class CASNumber (NamedItem): "Chemical Abstracts Service registery number" cas = _models.CharField( - 'CAS#', max_length=20) + 'CAS#', max_length=20, unique=True) def clean(self): if not _util.valid_CASno(self.cas):