使用系统自带的admin管理,内容后台显示过长,然后在list_display中定义相关的标签方法
def short_content(self): if len(str(self.content)) > 1000: return '{}...'.format(str(self.content)[0:1000]) else: return str(self.content) short_content.short_description="内容简介"
使用系统自带的admin管理,内容后台显示过长,然后在list_display中定义相关的标签方法
def short_content(self): if len(str(self.content)) > 1000: return '{}...'.format(str(self.content)[0:1000]) else: return str(self.content) short_content.short_description="内容简介"