我在哪里自定义ModelAdmin视图的标题? [英] Where do I customize the heading for the ModelAdmin view?
本文介绍了我在哪里自定义ModelAdmin视图的标题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果我有一个具有骆驼案例名称的模型,如 DepartmentalSuperLeader
;该模型的管理员视图的标题为
If I have a model with a camel case name like DepartmentalSuperLeader
; the admin view for this model has the heading
Departmental super leader
我想自定义这个名字。我应该覆盖什么方法?
I want to customize this name. What method should I override ?
推荐答案
您可以使用 verbose_name
的
其井例如:元
You can use the verbose_name
in the Meta
of the model
its well documented for eg:
class MyModel(Model):
.....
class Meta:
db_table = u"mytabel"
verbose_name = "My Custom Name"
这应该在管理员索引页面中显示您的模型,并设置 verbose_name
This should show your model in the admin index page with the set verbose_name
这篇关于我在哪里自定义ModelAdmin视图的标题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文