Skip to content

Commit

Permalink
Fixed #12477 - Fields specified in ModelAdmin.readonly_fields now res…
Browse files Browse the repository at this point in the history
…pect Field.verbose_name.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@12053 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
jezdez committed Jan 1, 2010
1 parent dab8743 commit 8465f49
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions django/contrib/admin/util.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -252,8 +252,7 @@ def lookup_field(name, obj, model_admin=None):


def label_for_field(name, model, model_admin): def label_for_field(name, model, model_admin):
try: try:
model._meta.get_field_by_name(name)[0] return model._meta.get_field_by_name(name)[0].verbose_name
return name
except models.FieldDoesNotExist: except models.FieldDoesNotExist:
if name == "__unicode__": if name == "__unicode__":
return force_unicode(model._meta.verbose_name) return force_unicode(model._meta.verbose_name)
Expand Down

0 comments on commit 8465f49

Please sign in to comment.