8

我怎样才能给这个类一个显示在后端而不是“EditedAddress”的标签?

class EditedAddressAdmin(admin.ModelAdmin):
    list_display = ('comp_name','fam_name', 'fon')
    search_fields = ['fam_name','comp_name']


admin.site.register(EditedAddress,EditedAddressAdmin)
4

1 回答 1

20

您可以通过向模型添加 verbose_name 和/或 verbose_name_plural 来调整模型名称的显示方式:

class EditedAddress(models.Model):
    class Meta:
        verbose_name = 'Edited Address'
        verbose_name_plural = 'Edited Addresses'
于 2013-03-14T20:41:22.390 回答