Can you change a field label in the Django Admin application?


Question

As the title suggests. I want to be able to change the label of a single field in the admin application. I'm aware of the Form.field attribute, but how do I get my Model or ModelAdmin to pass along that information?

1
43
12/13/2008 10:30:41 AM

Accepted Answer

the verbose name of the field is the (optional) first parameter at field construction.

69
12/13/2008 1:59:40 PM

If your field is a property (a method) then you should use short_description:

class Person(models.Model):
    ...

    def address_report(self, instance):
        ...
    # short_description functions like a model field's verbose_name
    address_report.short_description = "Address"

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon