views:

137

answers:

1

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?

+2  A: 
{{ bool_var|yesno:"Agree,Disagree" }}

You can also provide an additional string for the None case. See the docs for yesno for details.

Ayman Hourieh