[views] FinalView should display an empty string if value is None stable
authorAdrien Di Mascio <Adrien.DiMascio@logilab.fr>
Thu, 21 Jan 2010 11:13:39 +0100
branchstable
changeset 4315 2f957ad8e082
parent 4313 5d8196a105a7
child 4316 c4d4702ef87f
[views] FinalView should display an empty string if value is None
web/views/baseviews.py
--- a/web/views/baseviews.py	Thu Jan 21 11:07:32 2010 +0100
+++ b/web/views/baseviews.py	Thu Jan 21 11:13:39 2010 +0100
@@ -72,13 +72,16 @@
         etype = self.rset.description[row][col]
         value = self.rset.rows[row][col]
 
+        if value is None:
+            self.w(u'')
+            return
         if etype == 'String':
             entity, rtype = self.rset.related_entity(row, col)
             if entity is not None:
                 # yes !
                 self.w(entity.printable_value(rtype, value, format=format))
                 return
-        if etype in ('Time', 'Interval'):
+        elif etype in ('Time', 'Interval'):
             if etype == 'Interval' and isinstance(value, (int, long)):
                 # `date - date`, unlike `datetime - datetime` gives an int
                 # (number of days), not a timedelta