# Admin自定义返回列表PRO 例子:成绩
def score_custom(self,models_obj):
if models_obj.score < 60:
font_color = "red"
else:
font_color = "green"
return format_html('<span style="color:{};">{}</span>'.format(font_color,models_obj.score))
score_custom.admin_order_field = 'score' # 继承admin原字段的排序 但是在PRO上无法排序 在simpleui可以
score_custom.short_description = '成绩'