diff --git a/django/didgeridoo/currencies/views.py b/django/didgeridoo/currencies/views.py index a69fb90..0dcd960 100644 --- a/django/didgeridoo/currencies/views.py +++ b/django/didgeridoo/currencies/views.py @@ -11,12 +11,12 @@ from django.http import JsonResponse def CurrencyUpdate(request): - assert False currency = request.GET.get('CurrencyUpdate', None) data = { - 'currency': ExchangeRate_name.objects.filter( - name=currency) + 'currency': ExchangeRate_name.objects.get( + currency).id } + print('currency: ', currency, 'data: ', data) return JsonResponse(data) diff --git a/django/didgeridoo/static/js/app.js b/django/didgeridoo/static/js/app.js index 09c128c..90b51bc 100644 --- a/django/didgeridoo/static/js/app.js +++ b/django/didgeridoo/static/js/app.js @@ -1,4 +1,4 @@ - $("#id_currency").change(function () { + $("#CurrencyUpdate").change(function () { var currency = $(this).val(); $.ajax({ url: '/ajax/CurrencyUpdate/',