From 268b49ce97b1ba61461f72b7148c1a8a17c45f63 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sun, 1 Apr 2012 20:54:19 -0400 Subject: [PATCH] Fix recieved -> received typos and make NFPA warnings optional. For some niche chemicals, their are no MSDSs, or the chemicals have not been tested sufficiently to have warnings assigned. --- chemdb/fixtures/example_data.yaml | 14 +++++++------- chemdb/models.py | 13 ++++++++----- chemdb/templates/chemdb/chemical_instances.html | 4 ++-- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/chemdb/fixtures/example_data.yaml b/chemdb/fixtures/example_data.yaml index 290e332..aee3964 100644 --- a/chemdb/fixtures/example_data.yaml +++ b/chemdb/fixtures/example_data.yaml @@ -212,7 +212,7 @@ amount: 500 mL vendor: 1 catalog: A35-500 - recieved: 2001-07-05 + received: 2001-07-05 - model: chemdb.ChemicalInstance pk: 2 fields: @@ -221,7 +221,7 @@ amount: 100 g vendor: 2 catalog: 15523-012 - recieved: 2000-01-16 + received: 2000-01-16 - model: chemdb.ChemicalInstance pk: 3 fields: @@ -230,7 +230,7 @@ amount: 500 mL vendor: 4 catalog: VW3410-2 - recieved: 2000-01-17 + received: 2000-01-17 - model: chemdb.ChemicalInstance pk: 4 fields: @@ -239,7 +239,7 @@ amount: 500 g vendor: 2 catalog: 15527-013 - recieved: 2000-01-16 + received: 2000-01-16 - model: chemdb.ChemicalInstance pk: 5 fields: @@ -248,7 +248,7 @@ amount: 100 g vendor: 3 catalog: P1037 - recieved: 2006-01-17 + received: 2006-01-17 - model: chemdb.ChemicalInstance pk: 6 fields: @@ -257,7 +257,7 @@ amount: 500 g vendor: 4 catalog: JT4058-1 - recieved: 2000-10-22 + received: 2000-10-22 - model: chemdb.ChemicalInstance pk: 7 fields: @@ -266,4 +266,4 @@ amount: 500 mL vendor: 4 catalog: JT3727-1 - recieved: 2000-10-22 + received: 2000-10-22 diff --git a/chemdb/models.py b/chemdb/models.py index b0087cc..5ef57d1 100644 --- a/chemdb/models.py +++ b/chemdb/models.py @@ -51,9 +51,12 @@ class Chemical (NamedItem): msds = _models.FileField( 'Material safety data sheet', upload_to=_util.chemical_upload_to, blank=True, null=True) - health = _models.PositiveIntegerField('NFPA health rating') - fire = _models.PositiveIntegerField('NFPA fire rating') - reactivity = _models.PositiveIntegerField('NFPA reactivity rating') + health = _models.PositiveIntegerField( + 'NFPA health rating', blank=True, null=True) + fire = _models.PositiveIntegerField( + 'NFPA fire rating', blank=True, null=True) + reactivity = _models.PositiveIntegerField( + 'NFPA reactivity rating', blank=True, null=True) special = _models.ManyToManyField(NFPASpecial, blank=True, null=True) mutagen = _models.NullBooleanField() carcinogen = _models.NullBooleanField() @@ -90,8 +93,8 @@ class ChemicalInstance (_models.Model): amount = _models.CharField(max_length=100) vendor = _models.ForeignKey(Vendor, related_name='chemical_instances') catalog = _models.CharField('vendor catalog number', max_length=100) - recieved = _models.DateField(auto_now_add=True, editable=True) + received = _models.DateField(auto_now_add=True, editable=True) disposed = _models.DateField(blank=True, null=True) class Meta: - ordering = ['chemical', 'recieved', 'disposed', 'id'] + ordering = ['chemical', 'received', 'disposed', 'id'] diff --git a/chemdb/templates/chemdb/chemical_instances.html b/chemdb/templates/chemdb/chemical_instances.html index a24f0b6..d72adf1 100644 --- a/chemdb/templates/chemdb/chemical_instances.html +++ b/chemdb/templates/chemdb/chemical_instances.html @@ -11,7 +11,7 @@ ChemicalCAS#LocationAmount - VendorCatalog#RecievedDisposed + VendorCatalog#ReceivedDisposed @@ -24,7 +24,7 @@ {{ chemical_instance.amount }} {{ chemical_instance.vendor }} {{ chemical_instance.catalog }} - {{ chemical_instance.recieved }} + {{ chemical_instance.received }} {{ chemical_instance.disposed|default:'' }} {% endfor %} -- 2.26.2