[views] Discard Investigator primary view. Provide uicfg Brainomics primary view customization instead (related to #3340591)
authorVladimir Popescu <vladimir.popescu@logilab.fr>
Mon, 20 Jan 2014 12:57:02 +0000
changeset 634 f3d780ff56a1
parent 633 dc13d1bf2681
child 635 4e95aeb78d9a
[views] Discard Investigator primary view. Provide uicfg Brainomics primary view customization instead (related to #3340591)
views/primary.py
views/uicfg.py
--- a/views/primary.py	Mon Jan 20 11:50:53 2014 +0000
+++ b/views/primary.py	Mon Jan 20 12:57:02 2014 +0000
@@ -101,27 +101,6 @@
                 tab.render(self.w)
         w(u'</div>')
 
-###############################################################################
-### INVESTIGATOR ##############################################################
-###############################################################################
-class InvestigatorPrimaryView(BrainomicsPrimaryView):
-    __select__ = BrainomicsPrimaryView.__select__ & is_instance('Investigator')
-
-    def render_entity_attributes(self, entity):
-        return [(self._cw._('Firstname'), entity.firstname),
-                (self._cw._('Lastname'), entity.lastname),
-                (self._cw._('Title'), entity.title),
-                (self._cw._('Institution'), entity.institution),
-                (self._cw._('Department'), entity.department),]
-
-    def render_entity_relations(self, entity):
-        # Detailed assessments
-        # XXX Direct link to the measures/runs ?
-        self.w(u'<h3>%s</h3>' % xml_escape(self._cw._('Assessments conducted by this investigator')))
-        rset = self._cw.execute('Any A WHERE A conducted_by X, X eid %(e)s', {'e': entity.eid})
-        if rset:
-            self.wview('list', rset)
-
 
 ###############################################################################
 ### GENERIC TEST RUN ##########################################################
--- a/views/uicfg.py	Mon Jan 20 11:50:53 2014 +0000
+++ b/views/uicfg.py	Mon Jan 20 12:57:02 2014 +0000
@@ -117,3 +117,10 @@
 _pvdc.tag_object_of(('ScoreValue', 'definition', 'ScoreDefinition'),
                     {'vid': 'scorevalue-incontext-table-view', 'label': _('Scores')})
 
+
+###############################################################################
+### INVESTIGATOR ##############################################################
+###############################################################################
+_pvs.tag_object_of(('Assessment', 'conducted_by', 'Investigator'), 'relations')
+_pvdc.tag_object_of(('Assessment', 'conducted_by', 'Investigator'),
+                    {'vid': 'list', 'label': _('Assessments conducted by this investigator')})