Exemplo n.º 1
0
 def render_cell_content(self, session, data):
     checkin_timestamp = super(NodeInventory.CheckinColumn, self).render_cell_content(session, data)
     if checkin_timestamp > 0:
         checkin_value = datetime.fromtimestamp(float(checkin_timestamp/1000000))  # the timestamps we get are too large
         retval = fmt_datetime(checkin_value, sec=True)
     else:
         retval = "Never"     
     return retval
Exemplo n.º 2
0
 def render_datetime(self, session, value):
     #if the timestamp passed in is zero or negative, we translate that to
     # "NA" to display per BZ 696619
     timestamp = value        
     retval = "NA"
     if int(timestamp) > 0:
         value = datetime.fromtimestamp(int(value))
         retval = fmt_datetime(value)            
      
     return retval
Exemplo n.º 3
0
    def value(self, session, object):
        value = getattr(object, self.name, None)

        if isinstance(value, datetime):
            value = fmt_datetime(value)

        if isinstance(value, dict):
            value = fmt_dict(value, self.prefix)

        return value
Exemplo n.º 4
0
 def get_content(self, session, record):
     value = ""
     try:
         value = record[self.index]   
         if value > 0:
             checkin_value = datetime.fromtimestamp(float(value/1000000))  # the timestamps we get are too large
             value = fmt_datetime(checkin_value, sec=True)
         else:
             value = "Never"     
     except Exception, e:
         pass