首页 > 其他分享 >Django 限制字符串展示,超过30个展示...

Django 限制字符串展示,超过30个展示...

时间:2022-10-09 09:00:25浏览次数:56  
标签:... short 展示 process self 30 str

    def short_process_all(self):
        if len(str(self.process_all)) > 30:
            return '{}...'.format(str(self.process_all)[0:29])
        else:
            return str(self.process_all)

    short_process_all.allow_tags = True
    short_process_all.short_description = '问题描述'
    short_process_all.admin_order_field = 'code'

标签:...,short,展示,process,self,30,str
From: https://www.cnblogs.com/jubai/p/16770932.html

相关文章