def __unicode__(self): from base.templatetags.base_tags import fmt_shortdatetime from mysite.iclock.models.model_device import get_device try: return u"%s, %s" % (get_device(self.SN_id), self.CmdCommitTime) except: return u"%s, %s" % (self.SN_id, self.CmdCommitTime)
def __unicode__(self): from mysite.iclock.models.model_device import get_device sn_info = get_device(self.SN_id) try: return u"%s, %s, %s"%(sn_info, self.OpTime.strftime('%y-%m-%d %H:%M'), self.OP) except: return u"%s, %s, %s"%(self.SN_id, self.OpTime.strftime('%y-%m-%d %H:%M'), self.OP)
def device(self): return get_device(self.SN_id)