如何为此类提供一个标签,该标签显示在后端而不是“EditedAddress”?
class EditedAddressAdmin(admin.ModelAdmin):
list_display = ('comp_name','fam_name', 'fon')
search_fields = ['fam_name','comp_name']
admin.site.register(EditedAddress,EditedAddressAdmin)
答案 0 :(得分:17)
您可以通过向模型添加verbose_name和/或verbose_name_plural来调整模型名称的显示方式:
class EditedAddress(models.Model):
class Meta:
verbose_name = 'Edited Address'
verbose_name_plural = 'Edited Addresses'