Search code examples
djangodjango-modelsdjango-admin

Verbose name for admin model Class in django


Is it possible to create a verbose name for the actual Class model?

class User(models.Model):
    fname = models.CharField(max_length=50, verbose_name = 'first name')

So in the admin panel it will be referenced by its verbose name and not 'user' ?


Solution

  • class User(models.Model):
        fname = models.CharField(max_length=50, verbose_name = 'first name')
    
        class Meta:
             verbose_name = "users"
    

    Source: https://docs.djangoproject.com/en/2.1/topics/db/models/#meta-options