How to check whether the html value is 1 in django

Question:

home.html

        {% if  stud.scrapper_status == 1 %}
          <td>{{stud.scrapper_status}} --> Started</td>
        {% else %}
          <td>{{stud.scrapper_status}} --> Completed</td>
        {% endif %}

Output Image

If my value is 1 I should get started but for all the value its getting Completed, How to check the value if 1 or not in html

Asked By: Ajay

||

Answers:

It should be "1" not 1 so:

home.html

        {% if  stud.scrapper_status == "1" %}
          <td>{{stud.scrapper_status}} --> Started</td>
        {% else %}
          <td>{{stud.scrapper_status}} --> Completed</td>
        {% endif %}
Answered By: Sunderam Dubey
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.