From 9cc90057d8234047b6d684b1119dbf623b4d7344 Mon Sep 17 00:00:00 2001 From: Diane Trout Date: Tue, 24 May 2011 17:00:02 -0700 Subject: [PATCH] Make antibody & condition visible. Also change replicate number to allow null and not autodefault to 1. Lastly reorganize the fields on the library page to be a bit less confusing. --- htsworkflow/frontend/samples/admin.py | 19 ++- htsworkflow/frontend/samples/models.py | 11 +- .../templates/samples/library_detail.html | 137 ++++++++++++------ 3 files changed, 108 insertions(+), 59 deletions(-) diff --git a/htsworkflow/frontend/samples/admin.py b/htsworkflow/frontend/samples/admin.py index 6db3ba8..4247c88 100644 --- a/htsworkflow/frontend/samples/admin.py +++ b/htsworkflow/frontend/samples/admin.py @@ -47,11 +47,11 @@ class AntibodyOptions(admin.ModelAdmin): ) class CelllineOptions(admin.ModelAdmin): - list_display = ('cellline_name', 'nickname', 'notes') + list_display = ('cellline_name', 'notes') search_fields = ('cellline_name', 'nickname', 'notes') fieldsets = ( (None, { - 'fields': (('cellline_name'),('notes'),) + 'fields': (('cellline_name','nickname',),('notes'),) }), ) @@ -129,9 +129,16 @@ class LibraryOptions(admin.ModelAdmin): (None, { 'fields': ( ('id','library_name','hidden'), - ('library_species', 'cell_line', 'replicate'), - ('library_type', 'experiment_type')) + ('library_species', 'library_type', 'experiment_type'), + ) }), + ('Experiment Detail:', { + 'fields': (('cell_line', 'replicate',), + ('condition',), + ('antibody', ), + ), + 'classes': ('collapse',), + }), ('Creation Information:', { 'fields' : (('made_by', 'creation_date', 'stopping_point'), ('amplified_from_sample'), @@ -221,9 +228,9 @@ class TagOptions(admin.ModelAdmin): admin.site.register(Library, LibraryOptions) admin.site.register(Affiliation, AffiliationOptions) -#admin.site.register(Antibody, AntibodyOptions) +admin.site.register(Antibody, AntibodyOptions) admin.site.register(Cellline, CelllineOptions) -#admin.site.register(Condition, ConditionOptions) +admin.site.register(Condition, ConditionOptions) admin.site.register(ExperimentType, ExperimentTypeOptions) #admin.site.register(HTSUser, HTSUserOptions) admin.site.register(LibraryType, LibraryTypeOptions) diff --git a/htsworkflow/frontend/samples/models.py b/htsworkflow/frontend/samples/models.py index 8314c71..7584cfe 100644 --- a/htsworkflow/frontend/samples/models.py +++ b/htsworkflow/frontend/samples/models.py @@ -20,8 +20,7 @@ class Antibody(models.Model): max_length=20, blank=True, null=True, - db_index=True, - verbose_name = 'Short Name' + db_index=True ) catalog = models.CharField(max_length=50, unique=True, db_index=True) antibodies = models.CharField(max_length=500, db_index=True) @@ -39,8 +38,8 @@ class Cellline(models.Model): nickname = models.CharField(max_length=20, blank=True, null=True, - db_index=True, - verbose_name = 'Short Name') + db_index=True) + notes = models.TextField(blank=True) def __unicode__(self): return unicode(self.cellline_name) @@ -149,7 +148,7 @@ class Library(models.Model): # New field Aug/19/08 # SQL to add column: alter table fctracker_library add column "replicate" smallint unsigned NULL; REPLICATE_NUM = ((1,1),(2,2),(3,3),(4,4)) - replicate = models.PositiveSmallIntegerField(choices=REPLICATE_NUM,default=1) + replicate = models.PositiveSmallIntegerField(choices=REPLICATE_NUM,blank=True,null=True) experiment_type = models.ForeignKey(ExperimentType) library_type = models.ForeignKey(LibraryType, blank=True, null=True) creation_date = models.DateField(blank=True, null=True) @@ -199,7 +198,7 @@ class Library(models.Model): ordering = ["-id"] def antibody_name(self): - str =''+self.antibody.nickname+'' + str =''+self.antibody.label+'' return str antibody_name.allow_tags = True diff --git a/htsworkflow/frontend/templates/samples/library_detail.html b/htsworkflow/frontend/templates/samples/library_detail.html index 0aa83d0..412f201 100644 --- a/htsworkflow/frontend/templates/samples/library_detail.html +++ b/htsworkflow/frontend/templates/samples/library_detail.html @@ -59,59 +59,101 @@ { margin-bottom: .5em; } + + div.library_identity { + float: left; margin: 5px; } + div.library_sample_detail { float: left; margin: 5px; } + div.library_library_detail { float: left; margin: 5px; } + div.library_statistics { clear: both; border: 1px; } /* ]]> */ {% endblock %} {% block content %}
-

About this library

- Library ID: {{ lib.id }}
- Name: - {{ lib.library_name }} -
- Species: - {{ lib.library_species.scientific_name }} -
- Concentration: - {{ lib.undiluted_concentration }} ng/µl -
- Gel Cut Size: - {{ lib.gel_cut_size }} -
- Insert Size: - {{ lib.insert_size }} -
- Background or Cell Line: - {{ lib.cell_line }} -
- Replicate: - {{ lib.replicate }} -
- Library Type: - {{ lib.library_type }} -
- Experiment Type: - {{ lib.experiment_type }} -
- Made By: - {{ lib.made_by }} -
- Creation Date - {{ lib.creation_date }} -
- Protocol Stopping Point - {{ lib.stopping_point_name }} -
- Affiliations: - - +
+

Library Name

+ Library ID: {{ lib.id }}
+ Name: + {{ lib.library_name }} +
+ Affiliations: +
    + {% for individual in lib.affiliations.all %} +
  • + {{ individual.name }} ( {{ individual.contact }} ) +
  • + {% endfor %} +
+
+
+

Sample Details

+ Species: + {{ lib.library_species.scientific_name }} +
+ Experiment Type: + {{ lib.experiment_type }} +
+ {% if lib.antibody %} + Antibody: + {{ lib.antibody.antibodies }} + {% if lib.antibody.antibodies.nuckname %} + ({{ lib.antibody.nickname }}) + {% endif %} +
+ {% endif %} + {% if lib.cell_line %} + Background or Cell Line: + {{ lib.cell_line }} +
+ {% endif %} + {% if lib.condition %} + Condition: + {{ lib.condition.condition_name }} + {% if lib.condition.nickname %} + ({{ lib.condition.nickname }}) + {% endif %} +
+ {% endif %} + {% if lib.replicate %} + Replicate: + {{ lib.replicate }} +
+ {% endif %} +
+
+

Library Details

+ Library Type: + {{ lib.library_type }} +
+ Creation Date + {{ lib.creation_date }} +
+ Made By: + {{ lib.made_by }} +
+ {% if lib.gel_cut_size %} + Gel Cut Size: + {{ lib.gel_cut_size }} +
+ {% endif %} + {% if lib.insert_size %} + Insert Size: + {{ lib.insert_size }} +
+ {% endif %} + {% if lib.undiluted_concentration %} + Concentration: + {{ lib.undiluted_concentration }} ng/µl +
+ {% endif %} + {% if lib.stopping_point_name %} + Protocol Stopping Point + {{ lib.stopping_point_name }} +
+ {% endif %} +
+

Raw Result Files

@@ -247,5 +289,6 @@ {% endif %} {% endfor %} {% endblock %} + {% endblock %} -- 2.30.2