mirror of
https://github.com/django/django.git
synced 2024-11-30 07:06:18 +01:00
Fixed #12477 - Fields specified in ModelAdmin.readonly_fields now respect Field.verbose_name.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12053 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
dab8743193
commit
8465f49b63
@ -252,8 +252,7 @@ def lookup_field(name, obj, model_admin=None):
|
||||
|
||||
def label_for_field(name, model, model_admin):
|
||||
try:
|
||||
model._meta.get_field_by_name(name)[0]
|
||||
return name
|
||||
return model._meta.get_field_by_name(name)[0].verbose_name
|
||||
except models.FieldDoesNotExist:
|
||||
if name == "__unicode__":
|
||||
return force_unicode(model._meta.verbose_name)
|
||||
|
Loading…
Reference in New Issue
Block a user