Revert "change function name from camelcase to python syntactical underlines"
This reverts commit 213d231c81
.
This commit is contained in:
parent
213d231c81
commit
5e91470470
|
@ -1,10 +1,10 @@
|
||||||
from django.conf.urls import url
|
from django.conf.urls import url
|
||||||
from currencies.views import currencies, currency_update
|
from currencies.views import currencies, CurrencyUpdate
|
||||||
|
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
url(r'^currencies/$', currencies),
|
url(r'^currencies/$', currencies),
|
||||||
url(r'^ajax/currency_update/$',
|
url(r'^ajax/CurrencyUpdate/$',
|
||||||
currency_update,
|
CurrencyUpdate,
|
||||||
name='currency_update'),
|
name='CurrencyUpdate'),
|
||||||
]
|
]
|
||||||
|
|
|
@ -10,11 +10,11 @@ from currencies.forms import CurrencyForm
|
||||||
from django.http import JsonResponse
|
from django.http import JsonResponse
|
||||||
|
|
||||||
|
|
||||||
def currency_update(request):
|
def CurrencyUpdate(request):
|
||||||
currency = request.GET.get('currency_update', None)
|
currency = request.GET.get('CurrencyUpdate', None)
|
||||||
data = {
|
data = {
|
||||||
'currency': ExchangeRate.objects.filter(
|
'currency': ExchangeRate_name.objects.get(
|
||||||
name__name=currency).latest('date')
|
currency).id
|
||||||
}
|
}
|
||||||
print('currency: ', currency, 'data: ', data)
|
print('currency: ', currency, 'data: ', data)
|
||||||
return JsonResponse(data)
|
return JsonResponse(data)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
$("#currency_update").change(function () {
|
$("#CurrencyUpdate").change(function () {
|
||||||
var currency = $(this).val();
|
var currency = $(this).val();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '/ajax/currency_update/',
|
url: '/ajax/CurrencyUpdate/',
|
||||||
data: {
|
data: {
|
||||||
'currency': currency
|
'currency': currency
|
||||||
},
|
},
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
|
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
|
||||||
|
|
||||||
<!-- Add additional CSS in static file -->
|
<!-- Add additional CSS in static file -->
|
||||||
{% load static %}
|
{% load staticfiles %}
|
||||||
<link rel="stylesheet" href="{{ STATIC_URL }}/static/webshop/css/base.css" />
|
<link rel="stylesheet" href="{{ STATIC_URL }}/static/webshop/css/base.css" />
|
||||||
{% block title %}
|
{% block title %}
|
||||||
<title>
|
<title>
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
</ul>
|
</ul>
|
||||||
<form action="" method="POST" novalidate>
|
<form action="" method="POST" novalidate>
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
<select name="currency_update" id="currency_update" onchange="this.form.submit()">
|
<select name="CurrencyUpdate" id="CurrencyUpdate" onchange="this.form.submit()">
|
||||||
<option value="CHF">CHF</option>
|
<option value="CHF">CHF</option>
|
||||||
<option value="USD">USD</option>
|
<option value="USD">USD</option>
|
||||||
<option value="GBP">GBP</option>
|
<option value="GBP">GBP</option>
|
||||||
|
|
Loading…
Reference in New Issue