for andreas

This commit is contained in:
Ivan Hörler 2018-01-14 21:30:57 +01:00
parent 4ea27b0bbc
commit 2117c97874
2 changed files with 4 additions and 4 deletions

View File

@ -11,12 +11,12 @@ from django.http import JsonResponse
def CurrencyUpdate(request): def CurrencyUpdate(request):
assert False
currency = request.GET.get('CurrencyUpdate', None) currency = request.GET.get('CurrencyUpdate', None)
data = { data = {
'currency': ExchangeRate_name.objects.filter( 'currency': ExchangeRate_name.objects.get(
name=currency) currency).id
} }
print('currency: ', currency, 'data: ', data)
return JsonResponse(data) return JsonResponse(data)

View File

@ -1,4 +1,4 @@
$("#id_currency").change(function () { $("#CurrencyUpdate").change(function () {
var currency = $(this).val(); var currency = $(this).val();
$.ajax({ $.ajax({
url: '/ajax/CurrencyUpdate/', url: '/ajax/CurrencyUpdate/',