开发者

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?


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 :).


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

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜