Now using django-reversion to audit changes to django objects.
[htsworkflow.git] / samplebc / samples / models.py
index 8d53407747fe380032bd63728307ef2b2e1caaa9..86ed323a2a6387d35657577186569cf60afd8f90 100644 (file)
@@ -1,14 +1,20 @@
 from django.db import models
+from django.db.models import signals
+from django.contrib.auth.models import User, Group
 
-# Create your models here.
+#AUDIT_TYPES = [('Create', 'Create'),
+#               ('Update', 'Update'),
+#               ('Delete', 'Delete')]
 
 EXP_TYPES = [('RNASeq', 'RNASeq'),
              ('ChIPSeq','ChIPSeq'),
              ('DeNovoSeq','DeNovoSeq'),
              ('MethylSeq','MethylSeq')]
+
 FREEZER_BUILDINGS = [('Kerckhoff', 'Kerckhoff')]
 
 
+
 class Owner(models.Model):
     name = models.CharField(max_length=32)
     
@@ -23,6 +29,8 @@ class Freezer(models.Model):
     loc_desc = models.CharField(max_length=256, blank=True, null=True)
     temperature = models.FloatField(help_text='Celsius')
     
+    notes = models.TextField(blank=True, null=True)
+    
     uuid = models.CharField(max_length=32, unique=True)
     
     def __unicode__(self):
@@ -31,7 +39,7 @@ class Freezer(models.Model):
     @models.permalink
     def get_absolute_url(self):
         return ('samplebc.samples.views.freezer_summary', [str(self.uuid)])
-    
+
     
 class SampleType(models.Model):
     name = models.CharField(max_length=256)
@@ -46,6 +54,8 @@ class Container(models.Model):
     max_items = models.IntegerField()
     freezer = models.ForeignKey(Freezer)
     
+    notes = models.TextField(blank=True, null=True)
+    
     uuid = models.CharField(max_length=32, unique=True)
     
     def __unicode__(self):
@@ -67,6 +77,9 @@ class Sample(models.Model):
     sampleid = models.CharField(max_length=64, unique=True)
     sample_type = models.ForeignKey(SampleType)
     owner = models.ForeignKey(Owner)
+    
+    description = models.TextField()
+    
     # Concentration in ng/ul
     concentration = models.FloatField(help_text='ng/ul', blank=True, null=True)
     volume = models.FloatField(help_text='ul', blank=True, null=True)
@@ -78,3 +91,4 @@ class Sample(models.Model):
     @models.permalink
     def get_absolute_url(self):
         return ('samplebc.samples.views.sample_summary', [str(self.sampleid)])
+