答案 0 :(得分:0)
你可以在admin中使用django的tabularinlne以便于在新闻模型中插入
class NewsInline(admin.TabularInline):
model = News
extra = 0
show_change_link = True
def has_add_permission(self, request, obj=None):
return False
class ReporterAdmin(admin.ModelAdmin):
list_display = ['race', ....]
list_filter = ['race',....]
inlines = [NewsInline, ]
然后在admin
中注册您的模型
admin.site.register(Reporter, ReporterAdmin)