Change cluster_mac_id and seq_mac_id from text fields holding
[htsworkflow.git] / htsworkflow / frontend / experiments / models.py
index 5fdd7b25ce052564dc3caa152fdc5f159489c69a..0ac386eea254b0e72cfe13a44b52b95bb3e0edb2 100755 (executable)
@@ -2,6 +2,18 @@ from django.db import models
 from htsworkflow.frontend.samples.models import *
 from django.core.exceptions import ObjectDoesNotExist
 
+class ClusterStation(models.Model):
+  name = models.CharField(max_length=50, unique=True)
+
+  def __unicode__(self):
+    return unicode(self.name)
+
+class Sequencer(models.Model):
+  name = models.CharField(max_length=50, unique=True)
+
+  def __unicode__(self):
+    return unicode(self.name)
+
 class FlowCell(models.Model):
   
   flowcell_id = models.CharField(max_length=20, unique=True, db_index=True)
@@ -46,23 +58,10 @@ class FlowCell(models.Model):
   # lane_7_primer = models.ForeignKey(Primer,blank=True,null=True,related_name="lane_7_primer")
   # lane_8_primer = models.ForeignKey(Primer,blank=True,null=True,related_name="lane_8_primer")
 
-  #Machine Names
-  CLUSTER_MAC = (
-      ('M304','Cardinal'),
-      ('R349','R349'),
-      ('Tinkerbell','Tinkerbell'),
-      ('BitBit','BitBit'),
-    )
-  
-  SEQ_MAC = (
-      ('EAS149','Stanford'),
-      ('EAS46','EAS46'),
-      ('EAS45','Paris'),
-      ('Britney','Britney'),
-    )
-  
-  cluster_mac_id = models.CharField(max_length=50, choices=CLUSTER_MAC, default='BitBit')
-  seq_mac_id = models.CharField(max_length=50, choices=SEQ_MAC, verbose_name = 'Sequencer', default='Britney')
+  #cluster_mac_id = models.CharField(max_length=50, choices=CLUSTER_MAC, default='BitBit')
+  #seq_mac_id = models.CharField(max_length=50, choices=SEQ_MAC, verbose_name = 'Sequencer', default='Britney')
+  cluster_station = models.ForeignKey(ClusterStation)
+  sequencer = models.ForeignKey(Sequencer)
   
   notes = models.TextField(blank=True)
 
@@ -95,7 +94,6 @@ class FlowCell(models.Model):
   class Meta:
     ordering = ["-run_date"]
   
-
 ### -----------------------
 class DataRun(models.Model):
   ConfTemplate = "CONFIG PARAMS WILL BE GENERATED BY THE PIPELINE SCRIPT.\nYOU'LL BE ABLE TO EDIT AFTER IF NEEDED."