fixed little bug

This commit is contained in:
2018-04-27 10:13:39 -06:00
parent 6b6f5ff1f4
commit 208f37c230
3 changed files with 30 additions and 22 deletions

View File

@@ -7,21 +7,17 @@ import json
# Create your views here.
def get(request):
print(request)
value = request.GET.get('value')
frm = request.GET['from']
to = request.GET['to']
print(value, " ", to, " ", frm)
tmp = Converter.objects.get(units=frm)
print(tmp)
total = tmp.value * float(value)
print(str(total))
data = {}
data['units'] = to
data['value'] = total
json_data = json.dumps(data)
print(json_data)
return HttpResponse(json_data)
def init(request):