Reputation: 4306
I am trying to add three variables in django templates.
<p>{{s.a}}+{{s.b}}+{{s.c}}</p>
but its not doing the addition. how to do the addition of this tree variables and display final result without using jquery.
Upvotes: 1
Views: 752
Reputation: 471
I think it is better if you do your calculations in your views.py then pass them through render or render_to_response
def something(request):
value = your arithmetic...
return render(request, "template names", {'value': value})
Upvotes: 1