[views] Add therapy and disease in subject primary view, see #3341030
authorVincent Michel <vincent.michel@logilab.fr>
Mon, 02 Dec 2013 15:47:06 +0100
changeset 539 a64da0e12a4c
parent 538 f76cf12ef75c
child 548 cfceb5c8c70e
[views] Add therapy and disease in subject primary view, see #3341030
views/primary.py
--- a/views/primary.py	Tue Nov 26 11:20:01 2013 +0000
+++ b/views/primary.py	Mon Dec 02 15:47:06 2013 +0100
@@ -160,6 +160,19 @@
         if scores:
             self.w(u'<h3>%s</h3>' % self._cw._('Scores'))
             self.wview('list', scores)
+        # Therapies
+        therapies = self._cw.execute('Any X WHERE S related_therapies X, S eid %(e)s',
+                                     {'e': entity.eid})
+        if therapies:
+            self.w(u'<h3>%s</h3>' % xml_escape(self._cw._('Therapy_plural')))
+            self.wview('list', therapies)
+        # Diseases
+        diseases = self._cw.execute('Any X WHERE S related_diseases X, S eid %(e)s',
+                                     {'e': entity.eid})
+        if diseases:
+            self.w(u'<h3>%s</h3>' % xml_escape(self._cw._('Disease_plural')))
+            self.wview('list', diseases)
+
 
     def iterate_data(self, entity):
         data = []