Anas Rabei
Anas Rabei

Reputation: 317

django: change the title of the model in the admin

Django (1.4) by default adds the letter 's' to the model names in the admin site. For example, I have a model class nemed History. When looking in the admin site I found django named it Historys.

How could I remove this letter and keep the model name as it is ?

Upvotes: 3

Views: 2931

Answers (2)

catherine
catherine

Reputation: 22808

from django.utils.translation import ugettext_lazy as _

class ModelName(models.Model):
    .................

    class Meta:
        verbose_name_plural = _("History")

Upvotes: 3

aemdy
aemdy

Reputation: 3802

Define your own verbose_name_plural in model's Meta class.

https://docs.djangoproject.com/en/dev/ref/models/options/#verbose-name-plural

Upvotes: 0

Related Questions