add same id as value and name now it pops up because of app.js but does override somehow

This commit is contained in:
Ivan Hörler 2018-01-15 00:07:14 +01:00
parent 2a1a565f90
commit fce2f77cb2
3 changed files with 7 additions and 6 deletions

View File

@ -16,7 +16,7 @@ def currency_update(request):
print('its get method') print('its get method')
else: else:
print('its not get method') print('its not get method')
currency = request.GET.get('currency', None) currency = request.GET.get('currency_update', None)
data = ExchangeRate.objects.filter( data = ExchangeRate.objects.filter(
name__name=currency).values( name__name=currency).values(
'exchange_rate_to_chf').latest( 'exchange_rate_to_chf').latest(

View File

@ -1,15 +1,13 @@
$("#currency_update").change(function () { $("#currency_update").change(function () {
var currency = $(this).val(); var currency_update = $(this).val();
$.ajax({ $.ajax({
url: '/ajax/currency_update/', url: '/ajax/currency_update/',
data: { data: {
'currency': currency 'currency_update': currency_update
}, },
dataType: 'json', dataType: 'json',
success: function (data) { success: function (data) {
if (data.is_taken) { alert("es pop auf! --dies kommt von: static/js/app.js--.", data);
alert("es pop auf! --dies kommt von: static/js/app.js--.");
}
} }
}); });
}); });

View File

@ -28,6 +28,9 @@
<option value="GBP">GBP</option> <option value="GBP">GBP</option>
<option value="JPY">JPY</option> <option value="JPY">JPY</option>
</select> </select>
<ul class="nav navbar-nav">
{{ form.as_li }}
</ul>
</form> </form>
</div> </div>
</div> </div>