[views] Update Gene primary view to display several chromosomes if applicable (closes #3344757)

authorVladimir Popescu <vladimir.popescu@logilab.fr>
changeset8a97cbbec436
branchdefault
phasepublic
hiddenno
parent revision#a050c3245a7a [i18n] Update French i18n
child revision#cfc765b18d95 [css] Remove bootstrap-specific CSS (related to #3306560)., #bc6a8e888cb1 preparing 0.6.0
files modified by this revision
views/primary.py
# HG changeset patch
# User Vladimir Popescu <vladimir.popescu@logilab.fr>
# Date 1386576363 0
# Mon Dec 09 08:06:03 2013 +0000
# Node ID 8a97cbbec436b143dda41bd90f53c5efaf1584b2
# Parent a050c3245a7a224098cb7be85c8939a2c4f24115
[views] Update Gene primary view to display several chromosomes if applicable (closes #3344757)

diff --git a/views/primary.py b/views/primary.py
@@ -726,11 +726,11 @@
1 
2      def iterate_attributes(self, entity):
3          fields = [(self._cw._('Identifier'), entity.gene_id),
4                    (self._cw._('Start position'), entity.start_position),
5                    (self._cw._('Stop position'), entity.stop_position),
6 -                  (self._cw._('Chromosome'), entity.chromosome[0].view('outofcontext'))]
7 +                  (self._cw._('Chromosomes'), '; '.join(chrom.view('incontext') for chrom in entity.chromosomes))]
8          return fields
9 
10      def display_main_col(self, entity):
11          cgh_results = self._cw.execute('Any R WHERE R is CghResult, '
12                                         'R genomic_region G, G genes X, X eid %(e)s',
@@ -761,11 +761,11 @@
13                    (self._cw._('Start position'), entity.start),
14                    (self._cw._('Stop position'), entity.stop),
15                    (self._cw._('Width'), entity.width),
16                    (self._cw._('Cytoband start'), entity.cytoband_start),
17                    (self._cw._('Cytoband stop'), entity.cytoband_stop),
18 -                  (self._cw._('Chromosome'), entity.chromosome[0].view('outofcontext')),
19 +                  (self._cw._('Chromosome'), entity.chromosome[0].view('incontext')),
20                    (self._cw._('Genes'), u'<a href="%s">%s</a>' % (genes_url, self._cw._('See all genes')))]
21          return fields
22 
23      def display_main_col(self, entity):
24          cgh_results = self._cw.execute('Any R WHERE R is CghResult, '