Django janja compare database value

Hi I have some data store in the database In boolean. I want to check if the value is True pick the value and perform some action on it.

product: "{{DB_report_query.product.name}}"
{% if DB_report_query.product.summary  == True %}
{{DB_report_query.summary}}
{% endif %}

But this does not work

If it is a BooleanField then simply use the following:

{% if DB_report_query.product.summary %}
    {{DB_report_query.summary}}
{% endif %}
Back to Top