web/views/baseviews.py
changeset 7940 ac8052334e0d
parent 7918 d59db6068731
child 8130 85ade620056c
child 8416 e7f06e562a27
equal deleted inserted replaced
7937:3453c5f0db21 7940:ac8052334e0d
   130     Display the value of a result set cell with minimal transformations
   130     Display the value of a result set cell with minimal transformations
   131     (i.e. you'll get a number for entities). It is applicable on any result set,
   131     (i.e. you'll get a number for entities). It is applicable on any result set,
   132     though usually dedicated for cells containing an attribute's value.
   132     though usually dedicated for cells containing an attribute's value.
   133     """
   133     """
   134     __regid__ = 'final'
   134     __regid__ = 'final'
   135     # record generated i18n catalog messages
       
   136     _('%d years')
       
   137     _('%d months')
       
   138     _('%d weeks')
       
   139     _('%d days')
       
   140     _('%d hours')
       
   141     _('%d minutes')
       
   142     _('%d seconds')
       
   143     _('%d years')
       
   144     _('%d months')
       
   145     _('%d weeks')
       
   146     _('%d days')
       
   147     _('%d hours')
       
   148     _('%d minutes')
       
   149     _('%d seconds')
       
   150 
   135 
   151     def cell_call(self, row, col, props=None, format='text/html'):
   136     def cell_call(self, row, col, props=None, format='text/html'):
   152         value = self.cw_rset.rows[row][col]
   137         value = self.cw_rset.rows[row][col]
   153         if value is None:
   138         if value is None:
   154             self.w(u'')
   139             self.w(u'')
   161                 # about string format & all
   146                 # about string format & all
   162                 self.w(entity.printable_value(rtype, value, format=format))
   147                 self.w(entity.printable_value(rtype, value, format=format))
   163                 return
   148                 return
   164         value = self._cw.printable_value(etype, value, props)
   149         value = self._cw.printable_value(etype, value, props)
   165         if etype in ('Time', 'Interval'):
   150         if etype in ('Time', 'Interval'):
   166             value = value.replace(' ', ' ')
   151             self.w(value.replace(' ', ' '))
   167         self.wdata(value)
   152         else:
       
   153             self.wdata(value)
   168 
   154 
   169 
   155 
   170 class InContextView(EntityView):
   156 class InContextView(EntityView):
   171     """:__regid__: *incontext*
   157     """:__regid__: *incontext*
   172 
   158