web/views/primary.py
branchstable
changeset 8201 2ceb28e6aa76
parent 7990 a673d1d9a738
child 8206 f5f874d8a4f4
equal deleted inserted replaced
8200:182d47d87a5c 8201:2ceb28e6aa76
   417     both relations and attributes.
   417     both relations and attributes.
   418     """
   418     """
   419     __regid__ = 'attribute'
   419     __regid__ = 'attribute'
   420     __select__ = EntityView.__select__ & match_kwargs('rtype')
   420     __select__ = EntityView.__select__ & match_kwargs('rtype')
   421 
   421 
   422     def entity_call(self, entity, rtype, role, **kwargs):
   422     def entity_call(self, entity, rtype, role='subject', **kwargs):
   423         if self._cw.vreg.schema.rschema(rtype).final:
   423         if self._cw.vreg.schema.rschema(rtype).final:
   424             self.w(entity.printable_value(rtype))
   424             self.w(entity.printable_value(rtype))
   425         else:
   425         else:
   426             dispctrl = uicfg.primaryview_display_ctrl.etype_get(
   426             dispctrl = uicfg.primaryview_display_ctrl.etype_get(
   427                 entity.e_schema, rtype, role, '*')
   427                 entity.e_schema, rtype, role, '*')