我在admin.py中注册了我的模型,我想用标签列表更改某些模型字段名称。我知道如何在表单中执行此操作,但是在Admin模型类中提及标签并不能在Admin网站上反映出来。我需要帮助,如何使用Admin.py中的标签列表
class eAdmin(admin.ModelAdmin):
list_display = ('name', 'phone_number', 'email_id', 'country', 'state')
list_filter = ('funnel', 'country', 'state')
search_fields = ['email_id']
exclude = ('city',)
class Meta:
labels = labels_list
admin.site.register(EApplications, eAdmin)
在模型中,您可以添加详细的字段名称
first_name = models.CharField("person's first name", max_length=30)
请参见https://docs.djangoproject.com/en/3.0/topics/db/models/#verbose-field-names