70 |
70 |
71 def cell_call(self, row, col, props=None, format='text/html'): |
71 def cell_call(self, row, col, props=None, format='text/html'): |
72 etype = self.rset.description[row][col] |
72 etype = self.rset.description[row][col] |
73 value = self.rset.rows[row][col] |
73 value = self.rset.rows[row][col] |
74 |
74 |
|
75 if value is None: |
|
76 self.w(u'') |
|
77 return |
75 if etype == 'String': |
78 if etype == 'String': |
76 entity, rtype = self.rset.related_entity(row, col) |
79 entity, rtype = self.rset.related_entity(row, col) |
77 if entity is not None: |
80 if entity is not None: |
78 # yes ! |
81 # yes ! |
79 self.w(entity.printable_value(rtype, value, format=format)) |
82 self.w(entity.printable_value(rtype, value, format=format)) |
80 return |
83 return |
81 if etype in ('Time', 'Interval'): |
84 elif etype in ('Time', 'Interval'): |
82 if etype == 'Interval' and isinstance(value, (int, long)): |
85 if etype == 'Interval' and isinstance(value, (int, long)): |
83 # `date - date`, unlike `datetime - datetime` gives an int |
86 # `date - date`, unlike `datetime - datetime` gives an int |
84 # (number of days), not a timedelta |
87 # (number of days), not a timedelta |
85 # XXX should rql be fixed to return Int instead of Interval in |
88 # XXX should rql be fixed to return Int instead of Interval in |
86 # that case? that would be probably the proper fix but we |
89 # that case? that would be probably the proper fix but we |