Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to check whether the html value is 1 in django

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

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

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 %}
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading