Fix recieved -> received typos and make NFPA warnings optional.
authorW. Trevor King <wking@drexel.edu>
Mon, 2 Apr 2012 00:54:19 +0000 (20:54 -0400)
committerW. Trevor King <wking@drexel.edu>
Mon, 2 Apr 2012 00:54:19 +0000 (20:54 -0400)
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
chemdb/models.py
chemdb/templates/chemdb/chemical_instances.html

index 290e3323aaf1b190eaf529f5bbb8072903773da0..aee39645b71f1619c330851baa41193f92dd1da3 100644 (file)
     amount: 500 mL
     vendor: 1
     catalog: A35-500
-    recieved: 2001-07-05
+    received: 2001-07-05
 - model: chemdb.ChemicalInstance
   pk: 2
   fields:
     amount: 100 g
     vendor: 2
     catalog: 15523-012
-    recieved: 2000-01-16
+    received: 2000-01-16
 - model: chemdb.ChemicalInstance
   pk: 3
   fields:
     amount: 500 mL
     vendor: 4
     catalog: VW3410-2
-    recieved: 2000-01-17
+    received: 2000-01-17
 - model: chemdb.ChemicalInstance
   pk: 4
   fields:
     amount: 500 g
     vendor: 2
     catalog: 15527-013
-    recieved: 2000-01-16
+    received: 2000-01-16
 - model: chemdb.ChemicalInstance
   pk: 5
   fields:
     amount: 100 g
     vendor: 3
     catalog: P1037
-    recieved: 2006-01-17
+    received: 2006-01-17
 - model: chemdb.ChemicalInstance
   pk: 6
   fields:
     amount: 500 g
     vendor: 4
     catalog: JT4058-1
-    recieved: 2000-10-22
+    received: 2000-10-22
 - model: chemdb.ChemicalInstance
   pk: 7
   fields:
     amount: 500 mL
     vendor: 4
     catalog: JT3727-1
-    recieved: 2000-10-22
+    received: 2000-10-22
index b0087cc0695876b12fb47949ebccc2626c5dc039..5ef57d1cd95abf123e627f4500dc965ba0c50e62 100644 (file)
@@ -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']
index a24f0b6b1f315c7a1e8604ccba7966557fe2921c..d72adf1f032002b4688ddd17c69b6aa1cc90cf7c 100644 (file)
@@ -11,7 +11,7 @@
                <thead>
                        <tr>
                                <th>Chemical</th><th>CAS#</th><th>Location</th><th>Amount</th>
-                               <th>Vendor</th><th>Catalog#</th><th>Recieved</th><th>Disposed</th>
+                               <th>Vendor</th><th>Catalog#</th><th>Received</th><th>Disposed</th>
                        </tr>
                </thead>
                <tbody>
@@ -24,7 +24,7 @@
                                <td>{{ chemical_instance.amount }}</td>
                                <td>{{ chemical_instance.vendor }}</td>
                                <td>{{ chemical_instance.catalog }}</td>
-                               <td>{{ chemical_instance.recieved }}</td>
+                               <td>{{ chemical_instance.received }}</td>
                                <td>{{ chemical_instance.disposed|default:'' }}</td>
                        </tr>
        {% endfor %}