I have two variables in my Django template file
like
{{orderitem.value.id}}
and `
{{ orderitem.order.id }}
I need to show some data if they are equal but i don’t know how to compare variables in html files .
please suggest.
use ifequal tag to compare variables in templates:
sample:
{% ifequal orderitem.value.id orderitem.order.id %}
<p>are equals!<p/>
{% endifequal %}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With