def get_list_display(self, request):
# 如果是基于POST的'action_addseal'请求,修改list_display
# 点击待办盖章按钮,显示盖章项actcell_setseal
if request.session.get('push_action') == "action_addseal":
return ['creation_time', 'description', 'unit', 'user', 'actcell_setseal', ]
# 点击联合盖章按钮,可設置联合盖章單位,可刪除當前用戶的蓋章文件,dialog_setsealunit_url
elif request.session.get('push_action') == "action_addsealunit":
return ['creation_time', 'description', 'unit', 'user', 'seal_units_status', 'actcell_delfile',
'dialog_setsealunit_url', ]
# 已盖章
elif request.session.get('push_action') == "action_sealed":
return ['modification_time', 'description', 'unit', 'user', ]
如上,不是字段是按钮的情况下,切换时显示列会不正确,导致错乱,请修正