ModelAdmin
我有两个admin.py
这样的:
class ProjectAdmin(admin.ModelAdmin):
list_display = ('project_name', 'start_date', 'end_date')
list_filter = ['end_date']
search_fields = ['project_name']
class TaskAdmin(admin.ModelAdmin):
list_display = ('project', 'task_name', 'status', 'comment', 'deadline', 'last_updated')
list_filter = ['last_updated', 'deadline', 'status']
search_fields = ['project', 'task_name']
这列出了项目:
Project Name Start_date End_date
# Data
但我想自定义看起来像这样:
Project Name Task Name Deadline
# Project1 # Task 1 of Project1 # Task 1 Deadline
# Task 2 of project 1 # Deadline
# Task 3 of project 1 # Deadline
# Project 2 # Task 1 of project 2 # Deadline
and so on.
我怎样才能做到这一点?文档中是否包含类似的内容?我进行了快速搜索,但找不到继续前进的正确指针。
谢谢