(self, obj)
return result
:param obj:
        :return: 30天前
        remain_days<-30，return 30天前
        remain_days>-30，return 具体天数
:param obj:
        :return: 30天前
        remain_days<-30，return 30天前
        remain_days>-30，return 具体天数
: param obj : : return : 30天前 remain_days< - 30，return 30天前 remain_days > - 30，return 具体天数
def deadline_format(self, obj):
        '''
        :param obj:
        :return: 30天前
        remain_days<-30，return 30天前
        remain_days>-30，return 具体天数
        '''

        result = {"label":"","color":""}
        if obj.Status != 2 and obj.Status != 3:
            task = models.Task.objects.get(int(obj.id))
            remain_days = (task.DeadLine.replace(tzinfo=None)-datetime.datetime.utcnow()).days
            if remain_days<-100:
                label = '3个月前'
                result = {"label":label,"color":"red"}

            if remain_days < 0 and remain_days>-100:
                label = str(abs(remain_days)) + '天前'
                result = {"label":label,"color":"error"}
            if remain_days > 0 and remain_days<=7:
                label = str(remain_days) + '天后'
                result = {"label":label,"color":"volcano"}
            if remain_days>7:
                label = str(remain_days) + '天后'
                result = {"label":label,"color":"default"}

            if remain_days == 0:
                result = {"label":"今天","color":"primary"}
        return result
def deadline_format ( self , obj ) : result = { "label" : "" , "color" : "" } if obj . Status != 2 and obj . Status != 3 : task = models . Task . objects . get ( int ( obj . id ) ) remain_days = ( task . DeadLine . replace ( tzinfo = None ) - datetime . datetime . utcnow ( ) ) . days if remain_days < - 100 : label = '3个月前' result = { "label" : label , "color" : "red" } if remain_days < 0 and remain_days > - 100 : label = str ( abs ( remain_days ) ) + '天前' result = { "label" : label , "color" : "error" } if remain_days > 0 and remain_days <= 7 : label = str ( remain_days ) + '天后' result = { "label" : label , "color" : "volcano" } if remain_days > 7 : label = str ( remain_days ) + '天后' result = { "label" : label , "color" : "default" } if remain_days == 0 : result = { "label" : "今天","co l or":"pr i mary"} return result