Search code examples
pythonpython-3.xdjangodjango-modelsdjango-admin

django admin site change the display label of field


I hope the title is enough to understand what my issue is, I just want to change the default label Fathers Lastname: into Lastname without changing the table field name in the models

enter image description here

This is my models.py:

class ParentsProfile(models.Model):
    Fathers_Firstname = models.CharField(max_length=500,null=True,blank=True)
    Fathers_Middle_Initial = models.CharField("Middle Initial",max_length=500,null=True,blank=True, help_text="Father")
    Fathers_Lastname = models.CharField(max_length=500,null=True,blank=True)

Solution

  • try adding verbose_name

    Fathers_Firstname = models.CharField(verbose_name="Lastname",max_length=500,null=True,blank=True)