Django - How to access the verbose_name of a Model in its Admin Module?

前端 未结 2 458
梦如初夏
梦如初夏 2021-02-01 15:47

How to access the verbose_name of a Model in its Admin Module? We can access the same if we have an instance of that model like below.

instance._met         


        
2条回答
  •  走了就别回头了
    2021-02-01 15:52

    Model._meta.verbose_name.title() returns verbose name with First Character Uppercase while Model._meta.verbose_name_raw property returns the verbose name you wrote in the model class.

提交回复
热议问题