Tuesday, April 5, 2011

How to add custom field header names on change list page of Django admin interface?

I'm building a django site with the admin site enabled on the backend. I want to change the names shown on the headers for the various model fields without actually changing the name of the fields. Is there an easy way to do this? I've browsed the django site and can't seem to locate this information.

Anyone know if this can be done and how?

From stackoverflow
  • you can change the display name for a model field by passing verbose_name to the field definition

    field_1 = models.CharField(verbose_name='Field One', max_length=255)
    

    or simply

    field_1 = models.CharField('Field One', max_length=255)
    

0 comments:

Post a Comment