From 5a50f6291ef274f5cc1f7926f3b0b2a1e3580da7 Mon Sep 17 00:00:00 2001 From: Diane Trout Date: Mon, 9 Mar 2009 22:05:54 +0000 Subject: [PATCH] Change flowcell admin index page to include a formatted cluster estimate --- htsworkflow/frontend/experiments/models.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) 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 -- 2.30.2