I registered my model in admin.py, I want to change some model fields name with list of labels. I know how to do it in forms but mentioning labels in Admin model class are not reflecting it on Admin site. I need help how to use list of labels in 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)
I have more than 20 fields I can't do it manually in models.py I want to use labels list
in your models you can add verbose field names
or you can utilize help_text
see https://docs.djangoproject.com/en/3.0/topics/db/models/#verbose-field-names, https://docs.djangoproject.com/en/3.0/ref/models/fields/#help-text