简体   繁体   中英

django get_choices_display() displaying label in shell and value in view

When I try instance.get_choices_display() in shell, it is showing the label.

But, I do the same thing in the view, it is printing value.

What can be the reason?

I want the label to be returned/printed in the view.

如果您想要标签,我相信您想使用instance.label

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM