Issue
I have some django code that prints a BooleanField
it is rendered as True or False, can I change the label to be Agree/Disagree or do I need to write logic for that in the template?
Solution
{{ bool_var|yesno:"Agree,Disagree" }}
You can also provide an additional string for the None case. See the docs for yesno for details.
Answered By - Ayman Hourieh
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.