[ui] seda.business.link merged with seda.business with proper selector
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 12 Jul 2016 09:58:32 +0200
changeset 1408 7555792af428
parent 1407 c52594a26fcc
child 1409 19dd7d28374c
[ui] seda.business.link merged with seda.business with proper selector This makes it simpler to grasp by avoiding ambiguous semantic.
views/archiveunit.py
views/dataobject.py
views/viewlib.py
--- a/views/archiveunit.py	Fri Jul 08 16:35:02 2016 +0200
+++ b/views/archiveunit.py	Tue Jul 12 09:58:32 2016 +0200
@@ -147,7 +147,7 @@
     """Entity view for SEDAContent entities that will display value of the SEDATitle related
     element.
     """
-    __select__ = viewlib.BusinessValueLinkEntityView.__select__ & is_instance('SEDAContent')
+    __select__ = is_instance('SEDAContent')
     no_value_msg = _('<no title specified>')
 
     def entity_value(self, entity):
--- a/views/dataobject.py	Fri Jul 08 16:35:02 2016 +0200
+++ b/views/dataobject.py	Tue Jul 12 09:58:32 2016 +0200
@@ -236,7 +236,7 @@
 
 
 class RelationshipBusinessValueLinkEntityView(viewlib.BusinessValueLinkEntityView):
-    __select__ = viewlib.BusinessValueLinkEntityView.__select__ & is_instance('SEDARelationship')
+    __select__ = is_instance('SEDARelationship')
 
     def entity_value(self, entity):
         target = entity.seda_target[0] if entity.seda_target else None
--- a/views/viewlib.py	Fri Jul 08 16:35:02 2016 +0200
+++ b/views/viewlib.py	Tue Jul 12 09:58:32 2016 +0200
@@ -20,6 +20,7 @@
 from cubicweb.view import EntityView
 from cubicweb.web.views import tabs
 
+from cubes.seda.xsd2uicfg import FIRST_LEVEL_ETYPES
 from cubes.seda.views import add_subobjects_button
 
 _ = unicode
@@ -132,8 +133,8 @@
 
 
 class BusinessValueLinkEntityView(BusinessValueEntityView):
-    """Similar to seda.business but value is enclosed in a link if specified"""
-    __regid__ = 'seda.business.link'
+    """Similar to seda.business but value is enclosed in a link if some value is specified."""
+    __select__ = is_instance(*FIRST_LEVEL_ETYPES)
 
     def entity_value(self, entity):
         value = super(BusinessValueLinkEntityView, self).entity_value(entity)
@@ -143,11 +144,11 @@
 
 
 class LinkMetaEntityView(EntityView):
-    """Glue seda.business.link and seda.xsdmeta views together, for use within list"""
+    """Glue seda.business and seda.xsdmeta views together, for use within list."""
     __regid__ = 'seda.link_meta'
 
     def entity_call(self, entity):
-        entity.view('seda.business.link', w=self.w)
+        entity.view('seda.business', w=self.w)
         entity.view('seda.xsdmeta', w=self.w, skip_one_card=True)