From 02b279bc548b97d4d8386e589bf247b5635008ed Mon Sep 17 00:00:00 2001 From: Diane Trout Date: Tue, 6 Oct 2009 23:26:17 +0000 Subject: [PATCH] Add an account number field to a library. (Note SCHEMA CHANGE) 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 | 7 ++++++- htsworkflow/frontend/samples/models.py | 2 ++ htsworkflow/frontend/static/css/wide_account_number.css | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 htsworkflow/frontend/static/css/wide_account_number.css diff --git a/htsworkflow/frontend/samples/admin.py b/htsworkflow/frontend/samples/admin.py index 10f0eaf..5366e59 100644 --- a/htsworkflow/frontend/samples/admin.py +++ b/htsworkflow/frontend/samples/admin.py @@ -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'),) diff --git a/htsworkflow/frontend/samples/models.py b/htsworkflow/frontend/samples/models.py index 749c82e..57c7888 100644 --- a/htsworkflow/frontend/samples/models.py +++ b/htsworkflow/frontend/samples/models.py @@ -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 index 0000000..6eee12b --- /dev/null +++ b/htsworkflow/frontend/static/css/wide_account_number.css @@ -0,0 +1 @@ +#id_account_number { width: 50em; } \ No newline at end of file -- 2.30.2