Add an account number field to a library. (Note SCHEMA CHANGE)
authorDiane Trout <diane@caltech.edu>
Tue, 6 Oct 2009 23:26:17 +0000 (23:26 +0000)
committerDiane Trout <diane@caltech.edu>
Tue, 6 Oct 2009 23:26:17 +0000 (23:26 +0000)
We need some way to charge groups for our services, so it keeping
track of what account to use.

This does require a minor schema change.
alter table samples_library add column "account_number" varchar(100) NULL;

htsworkflow/frontend/samples/admin.py
htsworkflow/frontend/samples/models.py
htsworkflow/frontend/static/css/wide_account_number.css [new file with mode: 0644]

index 10f0eaf2713787c249894bb85c4d373dba920348..5366e593f90f1638b875b8f9e3f7470ee1dd4973 100644 (file)
@@ -86,6 +86,11 @@ class LibraryTypeOptions(admin.ModelAdmin):
     model = LibraryType
 
 class LibraryOptions(admin.ModelAdmin):
+    class Media:
+        css = {
+            "all": ("css/wide_account_number.css",)
+            }
+        
     date_hierarchy = "creation_date"
     save_as = True
     save_on_top = True
@@ -138,7 +143,7 @@ class LibraryOptions(admin.ModelAdmin):
           ('cell_line','condition','antibody'),)
          }),
          ('Creation Information:', {
-             'fields' : (('made_for', 'made_by', 'creation_date'), ('stopping_point', 'amplified_from_sample'), ('avg_lib_size','undiluted_concentration', 'ten_nM_dilution', 'successful_pM'), 'notes',)
+             'fields' : (('made_for', 'made_by', 'creation_date'), ('stopping_point', 'amplified_from_sample'), ('avg_lib_size','undiluted_concentration', 'ten_nM_dilution', 'successful_pM'), 'account_number', 'notes',)
          }),
          ('Library/Project Affiliation:', {
              'fields' : (('affiliations'), ('tags'),)
index 749c82eee4cb9e99aceafb783fa6241cf942091e..57c7888943aaf6c32b6d00e5e931c9b50437d81e 100644 (file)
@@ -134,6 +134,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()
+  # new field 2009 Oct 6, alter table samples_library add column "account_number" varchar(100) NULL
+  account_number = models.CharField(max_length=100, null=True, blank=True)
   cell_line = models.ForeignKey(Cellline, blank=True, null=True, verbose_name="Background")
   condition = models.ForeignKey(Condition, blank=True, null=True)
   antibody = models.ForeignKey(Antibody,blank=True,null=True)
diff --git a/htsworkflow/frontend/static/css/wide_account_number.css b/htsworkflow/frontend/static/css/wide_account_number.css
new file mode 100644 (file)
index 0000000..6eee12b
--- /dev/null
@@ -0,0 +1 @@
+#id_account_number { width: 50em; }
\ No newline at end of file