From 290ceecf73524b3d6fa48b8a147c93e3e5243ba7 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Mon, 2 Apr 2012 10:39:57 -0400 Subject: [PATCH] Don't allow duplicate records for the same CAS number. --- chemdb/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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): -- 2.26.2