How to do arthimetic operations on database values in django

12 views
Skip to first unread message

Mohan Goud

unread,
Nov 13, 2018, 8:49:27 AM11/13/18
to Django users


I have Prof:AssociateProf:AssistantProf = x:y:z in database and I have to do these operations x/(x+y+z) : y/(x+y+z) : z/(x+y+z) in django. Can anyone help me on this and models.py is

class Show(models.Model) :
Total = models.IntegerField(default = 0)
Prof = models.IntegerField(default = 0)
AssociateProf = models.IntegerField(default = 0)
AssistantProf = models.IntegerField(default = 0)
ResearchScholar = models.IntegerField(default = 0)
MTech = models.IntegerField(default = 0)
Reply all
Reply to author
Forward
0 new messages