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..
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 %}