[primary view] delete PrimaryView.skip_none attribute (closes #2093250) stable
authorAlexandre Richardson <alexandre.richardson@logilab.fr>
Fri, 10 Feb 2012 10:07:31 +0100
branchstable
changeset 8206 f5f874d8a4f4
parent 8205 14c52c5ee706
child 8207 c04676b16c59
[primary view] delete PrimaryView.skip_none attribute (closes #2093250) it was already broken anyway, since introduction of reledit (a while ago)
web/views/primary.py
--- a/web/views/primary.py	Fri Feb 10 10:06:19 2012 +0100
+++ b/web/views/primary.py	Fri Feb 10 10:07:31 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>')