开发者

Is there a "short_description" method for variables in Django?

I have a long variable name in one of my models "xxxx_xxxx_xx_xxxxxxxx" is there an equivilent of:

xxxx_xxxx_xx_xxxxxxxx.short_description = 'xxxx'

for variables or do I have to make a method to display that? I would like to not have to use a 开发者_JS百科method because I want to be able to sort by this variable in the Django admin. Thanks.


Look at the verbose field name option. It allows you use whatever name you like in the admin. There is also the verbose_name_plural for model names that have unusual plural construxions.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜