Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

234
Views
Calculate the procentage of to values in list Djangotemplate

So i am using Django to show me a list based on some input from the user. i want i to calculate the percentage of how many times the person have been there. so on the first row I want I to find the percentage of 5 out of 5 and the next for 1 out of 5. but right now it is just printing the math..

enter image description here

this is my Django template, where I just put in the math, but how do I make I calculate? do I need to have some javascript or?

{% extends 'base.html'%}
{% block content %}
<h1>list</h1>
<form method="get" action="/attendancecode/showattendance/">
    <p> Class <input type="text" value={{class}} name="class"/></p>
    <p> Subject <input type="text" value={{subject}} name="subject"/></p>
    <p><input type="submit" value="submit" name="submit"/></p>
</form>

    <h2>Students</h2>
    <ul>
        {% for attendance in object_list %}
            <li>{{ attendance.name}} has attended {{ attendance.countAttendance }} out of {{attendance.countLessons}} {{attendance.countAttendance}}/{{attendance.countLessons}}*100 </li>
        {% endfor %}
    </ul>
{% endblock %}

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!