From: Diane Trout Date: Mon, 9 Mar 2009 22:05:54 +0000 (+0000) Subject: Change flowcell admin index page to include a formatted cluster estimate X-Git-Tag: 0.2.0.2~21 X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=htsworkflow.git;a=commitdiff_plain;h=5a50f6291ef274f5cc1f7926f3b0b2a1e3580da7 Change flowcell admin index page to include a formatted cluster estimate --- diff --git a/htsworkflow/frontend/experiments/models.py b/htsworkflow/frontend/experiments/models.py index a6635c5..5ee1948 100755 --- a/htsworkflow/frontend/experiments/models.py +++ b/htsworkflow/frontend/experiments/models.py @@ -89,13 +89,19 @@ class FlowCell(models.Model): def Lanes(self): library_url = '/admin/samples/library/%s' - html = ['
    '] + html = [''] for i in range(1,9): - library_id = getattr(self, 'lane_%d_library_id' % i) + cluster_estimate = getattr(self, 'lane_%d_cluster_estimate' % (i,)) + if cluster_estimate is not None: + cluster_estimate = "%s k" % ((int(cluster_estimate)/1000), ) + else: + cluster_estimate = 'None' + library_id = getattr(self, 'lane_%d_library_id' % (i,)) library = getattr(self, 'lane_%d_library' % i) - element = '
  1. %s
  2. ' - html.append(element % (library_url % library_id, library)) - html.append('') + element = '' + expanded_library_url = library_url %(library_id,) + html.append(element % (i, expanded_library_url, library, cluster_estimate)) + html.append('
    %d%s%s
    ') return "\n".join(html) Lanes.allow_tags = True