Neo
Neo

Reputation: 13881

django: custom name for model in admin site

I have an app which includes a model "QuesTags". Now when I create an entry for this model in admin.py, the admin displays this model as "Ques tagss", which IMHO is totally unpalatable. Is there a way around( ex. short_description ) to display a custom string instead of parsing the original model name?

Upvotes: 2

Views: 648

Answers (2)

Arunabh Ghosh
Arunabh Ghosh

Reputation: 318

You can change the name in admin.py using meta class:

class QuesTags(models.Model):
    class Meta:
        verbose_name = 'QuesTag'
        verbose_name_plural = 'QuesTags'

Upvotes: 1

Neo
Neo

Reputation: 13881

Figured the way out. The model needed meta class option "verbose_name_plural"/"verbose_name". Google has all the answers, provided you know what you are searching for :).

Upvotes: 2

Related Questions