def percent(marks):
return (marks[0]+marks[1]+marks[2]+marks[3]/400)*100
marks1=[54,65,85,54]
percent1=percent(marks1)
marks2=[54,52,65,85]
percent2 = percent(marks2)
print(percent1,percent2)
Is there a way to force Django models to pass a field to a MySQL function every time the model data is read or loaded? To clarify what I mean in SQL, I want the Django model to produce something like ...