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:
Jannis Leidel 2010-01-01 21:37:36 +00:00
parent dab8743193
commit 8465f49b63
1 changed files with 1 additions and 2 deletions

View File

@ -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)