web/views/primary.py
changeset 8216 99ff746e8de8
parent 8190 2a3c1b787688
parent 8206 f5f874d8a4f4
child 8665 e65af61bde7d
--- a/web/views/primary.py	Fri Feb 10 16:31:39 2012 +0100
+++ b/web/views/primary.py	Fri Feb 10 16:53:52 2012 +0100
@@ -82,9 +82,6 @@
         Renders the relation label next to the relation value if set to `True`.
         Otherwise, does only display the relation value.
 
-    :attr:`skip_none`
-        Does not render an attribute value that is None if set to `True`.
-
     :attr:`main_related_section`
         Renders the relations of the entity if set to `True`.
 
@@ -99,7 +96,6 @@
     title = _('primary')
     show_attr_label = True
     show_rel_label = True
-    skip_none = True
     rsection = uicfg.primaryview_section
     display_ctrl = uicfg.primaryview_display_ctrl
     main_related_section = True
@@ -194,9 +190,7 @@
         return u''
 
     def render_entity_attributes(self, entity):
-        """Renders all attributes and relations in the 'attributes' section. The
-        :attr:`skip_none` attribute controls the display of `None` valued
-        attributes.
+        """Renders all attributes and relations in the 'attributes' section. 
         """
         display_attributes = []
         for rschema, _, role, dispctrl in self._section_def(entity, 'attributes'):
@@ -210,7 +204,7 @@
                     value = self._cw.view(vid, rset)
                 else:
                     value = None
-            if not self.skip_none or (value is not None and value != ''):
+            if value is not None and value != '':
                 display_attributes.append( (rschema, role, dispctrl, value) )
         if display_attributes:
             self.w(u'<table>')
@@ -419,7 +413,7 @@
     __regid__ = 'attribute'
     __select__ = EntityView.__select__ & match_kwargs('rtype')
 
-    def entity_call(self, entity, rtype, role, **kwargs):
+    def entity_call(self, entity, rtype, role='subject', **kwargs):
         if self._cw.vreg.schema.rschema(rtype).final:
             self.w(entity.printable_value(rtype))
         else: