fixed little bug
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user