Allow cellline and conditition to be blank [ticket:115] [ticket:105]
authorDiane Trout <diane@caltech.edu>
Tue, 30 Jun 2009 23:45:19 +0000 (23:45 +0000)
committerDiane Trout <diane@caltech.edu>
Tue, 30 Jun 2009 23:45:19 +0000 (23:45 +0000)
However this requires a dump and reload of the database to work.

This saves the data as a django 'fixture'
python manage.py dumpdata samples > /tmp/sampledata.json
python manage.py sqlreset samples | sqlite3 [path to db]
python manage.py loadddata /tmp/sampledata.json

htsworkflow/frontend/samples/models.py

index f51d250a8e862f7d562080adf0e0857f7f857e44..7f90f2521010c92434084f7afd60e4d055eb466b 100644 (file)
@@ -120,8 +120,8 @@ class Library(models.Model):
   library_species = models.ForeignKey(Species)
   # new field 2008 Mar 5, alter table samples_library add column "hidden" NOT NULL default 0;
   hidden = models.BooleanField()
-  cell_line = models.ForeignKey(Cellline, null=True)
-  condition = models.ForeignKey(Condition, null=True)
+  cell_line = models.ForeignKey(Cellline, blank=True, null=True)
+  condition = models.ForeignKey(Condition, blank=True, null=True)
   antibody = models.ForeignKey(Antibody,blank=True,null=True)
   # New field Aug/25/08. SQL: alter table fctracker_library add column "lib_affiliation" varchar(256)  NULL;
   affiliations = models.ManyToManyField(Affiliation,related_name='library_affiliations',null=True)