testpush
This commit is contained in:
parent
409b18807b
commit
776f81b3c9
|
@ -1,20 +0,0 @@
|
||||||
<!DOCTYPE HTML>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<html>
|
|
||||||
<head></head>
|
|
||||||
<body>
|
|
||||||
<header>
|
|
||||||
<h1>audioguide</h1>
|
|
||||||
<h3>a mobile offline audioguide</h3>
|
|
||||||
noop
|
|
||||||
noop
|
|
||||||
noop
|
|
||||||
noop
|
|
||||||
noop
|
|
||||||
noop
|
|
||||||
<p>the audioguide that makes a offline usage possible.</p>
|
|
||||||
</header>
|
|
||||||
<nav>
|
|
||||||
</nav>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -7,13 +7,3 @@ class ExchangeRate(models.Model):
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.name
|
return self.name
|
||||||
|
|
||||||
def exchange_rates():
|
|
||||||
exchange_rates = currencies.get_exchange_rate()
|
|
||||||
|
|
||||||
for i in exchange_rates:
|
|
||||||
if ExchangeRate.objects.filter(
|
|
||||||
name='exchange_rates_data[dictionary_value]'):
|
|
||||||
ExchangeRate.objects.filter(
|
|
||||||
name='exchange_rates_data[dictionary_key]',
|
|
||||||
exchange_rate_to_chf=exchange_rates.value).save()
|
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<head>
|
||||||
|
<link rel="stylesheet" href="{{ STATIC_URL }}/static/admin/css/base.css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="content" class="flex">
|
||||||
|
<h1>Music Shop</h1>
|
||||||
|
{% if currency_list %}
|
||||||
|
<ul>
|
||||||
|
{% for currency in currency_list %}
|
||||||
|
<li>{{ currency.name }} : {{ currency.exchange_rate_to_chf }}</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
{% else %}
|
||||||
|
<p>No categories are available.</p>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -1,7 +1,7 @@
|
||||||
from django.conf.urls import url
|
from django.conf.urls import url
|
||||||
|
from currencies.views import currencies
|
||||||
|
|
||||||
from . import views
|
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
url(r'^$', views.index, name='index'),
|
url(r'^currencies/$', currencies),
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,7 +1,18 @@
|
||||||
from django.shortcuts import render
|
from django.shortcuts import render
|
||||||
from django.http import HttpResponse
|
from .models import ExchangeRate
|
||||||
import exchange_rates
|
import exchange_rates
|
||||||
|
|
||||||
|
|
||||||
def index(request):
|
def currencies(request):
|
||||||
return HttpResponse(exchange_rates)
|
# return HttpResponse("exchange_rates")
|
||||||
|
currency_list = ExchangeRate.objects.all()
|
||||||
|
raw_data = exchange_rates.get_exchange_rate()
|
||||||
|
|
||||||
|
for i, j in raw_data.items:
|
||||||
|
ExchangeRate.objects.create(
|
||||||
|
name=i,
|
||||||
|
exchange_rate_to_chf=j)
|
||||||
|
|
||||||
|
return render(request,
|
||||||
|
'currencies/index.html',
|
||||||
|
{'currency_list': currency_list})
|
||||||
|
|
|
@ -18,6 +18,6 @@ from django.contrib import admin
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
url(r'', include('webshop.urls')),
|
url(r'', include('webshop.urls')),
|
||||||
url(r'^admin/', admin.site.urls),
|
url(r'', include('currencies.urls')),
|
||||||
url(r'^admin/', admin.site.urls),
|
url(r'^admin/', admin.site.urls),
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in New Issue