Odprta koda 2019. Web aplikacija Sensor.
Samo Penic
2019-04-11 fe4f05bd544255b4874ac8e60d2095a7a0b69dd4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from django.shortcuts import render
from django.http import HttpResponse
 
from .forms import Stevila
 
# Create your views here.
 
 
def sestej(request):
 
    form=Stevila()
    vsota="NaN"
 
    if request.method == "POST":
        print(request.POST['a'])
        form=Stevila(request.POST)
 
        if form.is_valid():
            vsota=float(form.data['a'])+float(form.data['b'])
 
            print(form.data)
    #form=Stevila()
    return render(request, 'calculator/sestej.html', context={'formular':form, 'vsota':vsota})