开发者

overriding admin field label content in django

开发者 https://www.devze.com 2023-04-01 07:45 出处:网络
I am using admin forms for the CRUD operations. However, I want to add certain characters in the labels generated by the admin. For example, * in case the field is required. How 开发者_如何学Pythoncan

I am using admin forms for the CRUD operations. However, I want to add certain characters in the labels generated by the admin. For example, * in case the field is required. How 开发者_如何学Pythoncan I accomplish it?

I can directly go into django admin code and add the * in there (in the file contrib/admin/helpers.py in this case) But it is not the right way. How can I do it?


There's no "great" way to do this, so your options will be css (add background img), subclassing form, template tags, or template modification. There are some good answers to this previous question here:

How to render form field with information that it is required

0

精彩评论

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