我有这两个模型管理员:
class SingleImageInline(generic.GenericTabularInline):
model = Image
extra = 1
max_num = 1
can_delete = False
class SponsorAdmin(admin.ModelAdmin):
fieldsets = [
('Basic Info', {
'fields': ['name']
}),
]
list_display = ['name']
search_fields = ['name']
inlines = [SingleImageInline, ]
Sponsor
有一个Image
名为logo
. 具有表单的管理表单SingleImageInline
已Images
显示在其标题中,有没有办法可以将其更改为Logo
,可能是这样的?
inlines = [(`Logo`, SingleImageInline), ]