views:

17

answers:

1

I'm using the smartif tag from this snippet (I'm holding on with regards to upgrading to 1.2) in my template for a certain boolean field like so:

{% if payment.extends_membership == "True" %}
   {% trans "Yes" %}
{% else %}
   {% trans "No" %}
{% endif %}

But whatever the value of extends_membership I get only No as the output. What could be the problem?

+2  A: 

Are you sure that extends_membership is a string, rather than a boolean?

In this particular case, you don't need smartif anyway - if it is a bool, you can just do:

{% if payment.extends_membership %}

and if you're sure it's a string, this will work:

{% ifequal payment.extends_membership "True" %}
Daniel Roseman
That did it Daniel...thnx :)...I got a bit confused there
Stephen