Merge branch 'currency'

* currency:
  corrected currencies app and added different view.
  correct the datetimefield on the orders model
  add the currencies app to the setup script
  vagrant provision does not work so i need to commit unsolved files
  commit for history. going to implement new databasestructure now.
  changed view and deleted the database unique filed
  add tableview in /currencies
  disable debugging for production
  Add date to currencies list
  Duno if thats your and my config and has to be ignored but for now il commit it.
  get currency from SNB rss to work
  testpush
  corrections and first try to migrate
  UN-finished Push of currency branch. Preview only, do not change. Ivan on charge.
This commit is contained in:
Ivan Hörler 2018-01-10 01:01:44 +01:00
commit 12ba3262ec
18 changed files with 1153 additions and 14 deletions

View File

@ -4,9 +4,11 @@ mysql < /vagrant/sql/01_create_database.sql
#remove old migrations
rm /vagrant/django/didgeridoo/webshop/migrations/*.py
rm /vagrant/django/didgeridoo/currencies/migrations/*.py
#create and insert the new migrations
python3 /vagrant/django/didgeridoo/manage.py makemigrations webshop
python3 /vagrant/django/didgeridoo/manage.py makemigrations currencies
python3 /vagrant/django/didgeridoo/manage.py migrate
#insert some default data into the database

View File

@ -2,7 +2,7 @@
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="jdk" jdkName="Python 3.6.3 (/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/bin/python3.6)" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="TestRunnerService">

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.6.3 (/usr/bin/python3.6)" project-jdk-type="Python SDK" />
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.6.3 (/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/bin/python3.6)" project-jdk-type="Python SDK" />
</project>

View File

View File

@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

View File

@ -0,0 +1,5 @@
from django.apps import AppConfig
class CurrenciesConfig(AppConfig):
name = 'currencies'

View File

@ -0,0 +1,133 @@
from datetime import datetime
import urllib.request
import xml.etree.ElementTree as ET
import datetime as dt
"""
this method calls a rss/XML Resource
of Currency's and parses it to our
needed exchange rate values.
The return is a dictionary carring
Key:Value pairs of new currencys.
"""
def get_exchange_rate():
# During weekends there are no updates.
# To develop i need a testresource.
# In that case i comment the Online Resource block and uncomment the
# development Block...
# ~~~~~~~~~~~~~~~~~~~~~
# Online Resource block:
# ~~~~~~~~~~~~~~~~~~~~~
today = datetime.now().strftime("%Y-%m-%d")
SNB_URL = 'https://www.snb.ch/selector/de/mmr/exfeed/rss'
urlsocket = urllib.request.urlopen(SNB_URL)
root = ET.parse(urlsocket)
root = ET.ElementTree(root)
# ~~~~~~~~~~~~~~~~~~~~~
# development block:
# ~~~~~~~~~~~~~~~~~~~~~
# today = "2018-01-03"
# try:
# root = ET.ElementTree(file='rss')
# except Exception as e:
# print('exchange_rates.py_urlsocket failed %s (
# %s) on date: %s for %s'
# % (e, type(e), root))
# ~~~~~~~~~~~~~~~~~~~~~
# Namespaces
ns = {'rdf': 'http://www.w3.org/1999/02/22-rdf-syntax-ns#',
'none': 'http://purl.org/rss/1.0/',
'dc': 'http://purl.org/dc/elements/1.1/',
'dcterms': 'http://purl.org/dc/terms/',
'cb': 'http://www.cbwiki.net/wiki/index.php/Specification_1.2/'
}
# Pathvariables to XML Namespaces
rate_path = 'cb:statistics/cb:exchangeRate/'
observation_path = 'cb:statistics/cb:exchangeRate/cb:observation/'
exchange_rates = {}
for item in root.findall('none:item', ns):
# THE CURRENCY DATE:
datetime_str = item.find('dc:date', ns).text
# convert string to date object:
# https://stackoverflow.com/a/12282040/4061870
# seams like snb striked the microsecond somewhere between Nov. and
# Dez. 2017 so maybe first check time type is with milliseconds:
try:
date = datetime.strptime(''.join(
datetime_str.rsplit(':', 1)),
"%Y-%m-%dT%H:%M:%S%z").strftime(
"%Y-%m-%d")
except:
try:
date = datetime.strptime(''.join(
datetime_str.rsplit(':', 1)),
"%Y-%m-%dT%H:%M:%S.%f%z").strftime(
"%Y-%m-%d")
except Exception as e:
print('%s (%s)' % (e, type(e)))
# Print dates for development:
# print("date:", date, "today:", today)
# only the values of today are used so check for date in XML:
if date == today:
target_currency = item.find(rate_path +
'cb:targetCurrency', ns).text
value = float(item.find(observation_path +
'cb:value', ns).text)
value = float(value) # convert to float
foreign_value = value # copy to new value to have both.
# because it's dangerous to check for present, i check for none
# here and have to do something in there so i set the target to 1.
if item.find(observation_path + 'cb:unit_mult', ns) is None:
unit_mult = float("1.0")
else:
# shift left by 2 digits with "/"
# https://stackoverflow.com/questions/8362792/
# because some currencys differ widly from CHF
unit_mult = item.find(observation_path +
'cb:unit_mult', ns).text
# unit_mult defaults to '0' so we check for 8 decimal
# values (2..-6) they represent the fracton value to
# calculate the correct decimalpoint.
if unit_mult == '2': # thinking of Bitcoins
unit_mult = '0.01'
if unit_mult == '1':
unit_mult = '0.10'
if unit_mult == '-1':
unit_mult = '10'
if unit_mult == '-2': # Japan Yen
unit_mult = '100'
if unit_mult == '-3':
unit_mult = '1000'
if unit_mult == '-4':
unit_mult = '10000'
if unit_mult == '-5':
unit_mult = '100000'
if unit_mult == '-6': # indian rupies
unit_mult = '1000000'
unit_mult = float(unit_mult) # convert to float
# calculate the Currency to CHF:
foreign_value = 1 / value
foreign_value *= unit_mult
value = value / unit_mult
# truncate it to decimal values provided by the xml:
foreign_value_round = round(foreign_value, 5)
# Print nice setup of all calculated currencys for Dev:
# print("date:", date, " 1 ", target_currency, " costs: ",
# CHFvalue, "CHF and 1 ", base_currency, " costs: ",
# FOREIGNvalue_round, target_currency)
exchange_rates.update(
{target_currency: foreign_value_round})
# Print the Dictionary:
# print(exchange_rates)
else:
exchange_rates = "SNB did not update the currencies for today."
return(exchange_rates, today)
# for development its preferable to see that the for loop is done:
# print('no more fresh data!')

View File

@ -0,0 +1,48 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2018-01-09 18:21
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='ExchangeRate',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('exchange_rate_to_chf', models.DecimalField(decimal_places=5, max_digits=12)),
],
),
migrations.CreateModel(
name='ExchangeRate_date',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('date', models.DateField(unique_for_date=True, verbose_name='%Y-%m-%d')),
],
),
migrations.CreateModel(
name='ExchangeRate_name',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=200, unique=True)),
],
),
migrations.AddField(
model_name='exchangerate',
name='date',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='currencies.ExchangeRate_date'),
),
migrations.AddField(
model_name='exchangerate',
name='name',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='currencies.ExchangeRate_name'),
),
]

View File

@ -0,0 +1,26 @@
from django.db import models
from decimal import Decimal
import datetime
class ExchangeRate_name(models.Model):
name = models.CharField(max_length=200, unique=True)
def __str__(self):
return self.name
class ExchangeRate_date(models.Model):
date = models.DateField('%Y-%m-%d', unique_for_date=True)
def __str__(self):
return str(self.date)
class ExchangeRate(models.Model):
name = models.ForeignKey(ExchangeRate_name)
date = models.ForeignKey(ExchangeRate_date)
exchange_rate_to_chf = models.DecimalField(max_digits=12, decimal_places=5)
def __str__(self):
return str(self.name)

View File

@ -0,0 +1,123 @@
<!DOCTYPE html>
<head>
<link rel="stylesheet" href="{{ STATIC_URL }}/static/admin/css/base.css" />
</head>
<body>
<div id="content" class="flex">
<h1>Currencies in CHF</h1>
<p> {{ message }} </p>
<h2> Frühere Daten: </h2>
<br>
<h3> US Dollars: </h3>
{% if currency_USD_list %}
<table>
<tr>
{% for element in currency_USD_list %}
{% for key, value in element.items %}
<th scope="col">{{ key }}</th>
{% endfor %}
{% endfor %}
<tr>
{% for element in currency_USD_list %}
<tr>
{% for key, value in element.items %}
<td scope="col">{{ value }}</td>
{% endfor %}
<tr>
{% endfor %}
</table>
{% else %}
<p class="alert">
currency_USD_list missing.
</p>
{% endif %}
<br>
<h3> EURO: </h3>
{% if currency_EUR_list %}
<table>
<tr>
{% for element in currency_EUR_list %}
{% for key, value in element.items %}
<th scope="col">{{ key }}</th>
{% endfor %}
{% endfor %}
<tr>
{% for element in currency_EUR_list %}
<tr>
{% for key, value in element.items %}
<td scope="col">{{ value }}</td>
{% endfor %}
<tr>
{% endfor %}
</table>
{% else %}
<p class="alert">
currency_EUR_list missing.
</p>
{% endif %}
<br>
<h3> Japanese Yenn: </h3>
{% if currency_JPY_list %}
<table>
<tr>
{% for element in currency_JPY_list %}
{% for key, value in element.items %}
<th scope="col">{{ key }}</th>
{% endfor %}
{% endfor %}
<tr>
{% for element in currency_JPY_list %}
<tr>
{% for key, value in element.items %}
<td scope="col">{{ value }}</td>
{% endfor %}
<tr>
{% endfor %}
</table>
{% else %}
<p class="alert">
currency_JPY_list missing.
</p>
{% endif %}
<br>
<h3> Great Britain Pounds: </h3>
{% if currency_GBP_list %}
<table>
<tr>
{% for element in currency_GBP_list %}
{% for key, value in element.items %}
<th scope="col">{{ key }}</th>
{% endfor %}
{% endfor %}
<tr>
{% for element in currency_GBP_list %}
<tr>
{% for key, value in element.items %}
<td scope="col">{{ value }}</td>
{% endfor %}
<tr>
{% endfor %}
</table>
{% else %}
<p class="alert">
currency_GBP_list missing.
</p>
{% endif %}
<br>
<!-- <br>
<h2> The full List of Currencies </h2>
<ul>
{% for currency in currency_list %}
<li>
{{ currency.date.date }} :
{{ currency.name.name }} :
{{ currency.exchange_rate_to_chf }}
</li>
{% endfor %}
</ul>
count_raw_data
<br>
{{ count_raw_data }} -->
</div>
</body>
</html>

View File

@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

View File

@ -0,0 +1,7 @@
from django.conf.urls import url
from currencies.views import currencies
urlpatterns = [
url(r'^currencies/$', currencies),
]

View File

@ -0,0 +1,175 @@
from django.shortcuts import render
import datetime
from currencies.models import (ExchangeRate,
ExchangeRate_date,
ExchangeRate_name)
from currencies import exchange_rates
def currencies(request):
# this function fetches the data from exchange_rates.py
# evaluates if the values are already stored and
# prepares the view all dynamicaly.
# It can grow in terms of more Currencies over time automaticaly.
# try:
today = '1970-01-01'
raw_data = ''
raw_data, today = exchange_rates.get_exchange_rate()
# except Exception as e:
# print('get_exchange_rate() %s (%s) on %s'
# % (e, type(e), today))
message_no = "Already querried today: "
message_yes = " Updated successfully: "
count_raw_data = 0
if raw_data == "SNB did not update the currencies for today.":
message = """Die SNB hat die Währungsliste noch nicht aktualisiert."""
else:
for currency, rate in raw_data.items():
count_raw_data += 1
if ExchangeRate.objects.filter(
date__date=today,
name__name=currency):
message_no += currency + ", "
# A: https://stackoverflow.com/a/27802801/4061870
else:
if ExchangeRate_date.objects.filter(date=today)[:1]:
try:
# lustigerweise gibt .values() den value und den id
# zurück. Ohne .values() gibts nur den "value"
date_dict = ExchangeRate_date.objects.filter(
date=today).values()
date = date_dict[0]['date']
date_id = date_dict[0]['id']
except Exception as e:
print('exdate_exists %s (%s) on %s'
% (e, type(e), today))
else:
try:
exdate = ExchangeRate_date.objects.create(
date=today)
exdate.save()
except Exception as e:
print('exdate_not_exists %s (%s) for %s'
% (e, type(e), today))
if ExchangeRate_name.objects.filter(
name=currency)[:1]:
try:
name_dict = ExchangeRate_name.objects.filter(
name=currency).values()
name = name_dict[0]['name']
name_id = name_dict[0]['id']
except Exception as e:
print('exname_exists %s (%s) on %s'
% (e, type(e), currency))
else:
try:
exname = ExchangeRate_name.objects.create(
name=currency)
exname.save()
except Exception as e:
print('exname_not_exists %s (%s) on %s'
% (e, type(e), currency))
try:
exrate = ExchangeRate.objects.create(
# name_id=name_id,
name_id=ExchangeRate_name.objects.get(
name=currency).id,
# date_id=date_id,
date_id=ExchangeRate_date.objects.get(
date=today).id,
exchange_rate_to_chf=rate,
)
exrate.save()
message_yes += currency + ", "
except Exception as e:
print('exrate_create %s (%s) on %s for %s'
% (e, type(e), currency, today))
# prepare messages:
message_no = message_no[::-1] # invert the string
message_no = message_no.replace(",", "!", 1) # replace first , with !
message_no = message_no[::-1] # invert the string back
message_yes = message_yes[::-1] # invert the string
message_yes = message_yes.replace(",", "!", 1) # replace first , with !
message_yes = message_yes[::-1] # invert the string back
if len(message_no) > 24 and len(message_yes) > 23:
message = message_no + message_yes
elif len(message_no) > 24:
message = message_no
elif len(message_yes) > 23:
message = message_yes
elif datetime.datetime.today().isoweekday() == 6:
message = """Die Abfrage wurde ohne ergebniss beendet.
Es ist Samstag, die SNB publiziert nur an Arbeitstagen neue Kurse...
"""
elif datetime.datetime.today().isoweekday() == 7:
message = """Die Abfrage wurde ohne ergebniss beendet.
Es ist Sonntag, die SNB publiziert nur an Arbeitstagen neue Kurse...
"""
else:
message = """Die Abfrage wurde ohne ergebniss beendet.
Kann es sein dass die SNB aufgrund eines Feiertages geschlossen ist?
"""
currency_list = ExchangeRate.objects.all()
currency_USD_list = ExchangeRate.objects.filter(name__name='USD').values()
currency_EUR_list = ExchangeRate.objects.filter(name__name='EUR').values()
currency_JPY_list = ExchangeRate.objects.filter(name__name='JPY').values()
currency_GBP_list = ExchangeRate.objects.filter(name__name='GBP').values()
# -------------------------------------------------------------------
# -------------------------------------------------------------------
# I leave this part in the document as history.
# Problem is that i get the expected List with dictionaries like:
# view_currencies_list[
# {'date': '2017-12-29, 'USD':'1.00', 'EUR':'1.00', 'GBP':'1.00', 'JPY':'1.00'},
# {'date': '2017-12-30, 'USD':'1.00', 'EUR':'1.00', 'GBP':'1.00', 'JPY':'1.00'},
# ]
# but the dict of 'date:' does not seam to deliver the same values as
# the dict's of key name:'USD' im not able to fix this in moment.
# nor am i able to generate a HTML table with date | USD | EUR | ...
# -------------------------------------------------------------------
# -------------------------------------------------------------------
# prepare data to be displayed in a html table:
# https://stackoverflow.com/questions/8749158/removing-duplicates-from-dictionary#8749473
# A: https://stackoverflow.com/questions/37205793/django-values-list-vs-values#37205928
# B: https://stackoverflow.com/questions/6521892/how-to-access-a-dictionary-key-value-present-inside-a-list
# # search for currencies in a date and apend them to the list
# view_currency_list = []
# view_currencies_list = ExchangeRate_name.objects.all()
# view_dates_list = ExchangeRate_date.objects.all()
# count_date = 0
# count_currencies = 0
# for view_date in view_dates_list:
# count_date += 1
# view_currency_dict = {view_date}
# # view_currency_dict.update({})
# for view_currency in view_currencies_list:
# count_currencies += 1
# try:
# x = ExchangeRate.objects.filter(date__date=str(
# view_date),
# name__name=str(
# view_currency
# )).values() # A
# view_exchange_rate_to_chf = x[0]['exchange_rate_to_chf']
# except Exception as e:
# print('prepare_view %s (%s) for %s on %s is %s'
# % (e, type(e), view_currency, view_date,
# view_exchange_rate_to_chf))
# view_exchange_rate_to_chf = " "
#
# view_currency_dict.update({view_currency:
# view_exchange_rate_to_chf}) # B
#
# view_currency_list.append(view_currency_dict)
# assert False
return render(request,
'currencies/index.html',
{'currency_list': currency_list,
'currency_USD_list': currency_USD_list,
'currency_EUR_list': currency_EUR_list,
'currency_JPY_list': currency_JPY_list,
'currency_GBP_list': currency_GBP_list,
'count_raw_data': count_raw_data,
'message': message})

View File

@ -35,6 +35,7 @@ ALLOWED_HOSTS = [
# Application definition
INSTALLED_APPS = [
'currencies',
'webshop.apps.WebshopConfig',
'django_extensions',
'django.contrib.admin',
@ -43,7 +44,7 @@ INSTALLED_APPS = [
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
]
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',

View File

@ -20,6 +20,6 @@ from django.conf.urls.static import static
urlpatterns = [
url(r'', include('webshop.urls')),
url(r'^admin/', admin.site.urls),
url(r'', include('currencies.urls')),
url(r'^admin/', admin.site.urls),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

621
django/didgeridoo/rss Normal file
View File

@ -0,0 +1,621 @@
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:cb="http://www.cbwiki.net/wiki/index.php/Specification_1.2/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/">
<channel rdf:about="https://www.snb.ch/de/ifor/media/id/media_rss">
<title>SNB Devisenkurse</title>
<link>https://www.snb.ch/de/ifor/media/id/media_rss</link>
<description>Schweizerische Nationalbank (SNB): Devisenkurse (Ankauf Zürich 11 Uhr)</description>
<items>
<rdf:Seq>
<rdf:li rdf:resource="https://www.snb.ch#GBP_6ec827d359194a0a002581e5003df8a5"/>
<rdf:li rdf:resource="https://www.snb.ch#JPY_6ec827d359194a0a002581e5003df8a5"/>
<rdf:li rdf:resource="https://www.snb.ch#EUR_6ec827d359194a0a002581e5003df8a5"/>
<rdf:li rdf:resource="https://www.snb.ch#USD_6ec827d359194a0a002581e5003df8a5"/>
<rdf:li rdf:resource="https://www.snb.ch#GBP_f4a6fbc20fb0403d002581e2003e3d67"/>
<rdf:li rdf:resource="https://www.snb.ch#JPY_f4a6fbc20fb0403d002581e2003e3d67"/>
<rdf:li rdf:resource="https://www.snb.ch#EUR_f4a6fbc20fb0403d002581e2003e3d67"/>
<rdf:li rdf:resource="https://www.snb.ch#USD_f4a6fbc20fb0403d002581e2003e3d67"/>
<rdf:li rdf:resource="https://www.snb.ch#GBP_6568365cd292474b002581e1003fca55"/>
<rdf:li rdf:resource="https://www.snb.ch#JPY_6568365cd292474b002581e1003fca55"/>
<rdf:li rdf:resource="https://www.snb.ch#EUR_6568365cd292474b002581e1003fca55"/>
<rdf:li rdf:resource="https://www.snb.ch#USD_6568365cd292474b002581e1003fca55"/>
<rdf:li rdf:resource="https://www.snb.ch#GBP_0d6cfaf1d11a41f8002581e0003ea07c"/>
<rdf:li rdf:resource="https://www.snb.ch#JPY_0d6cfaf1d11a41f8002581e0003ea07c"/>
<rdf:li rdf:resource="https://www.snb.ch#EUR_0d6cfaf1d11a41f8002581e0003ea07c"/>
<rdf:li rdf:resource="https://www.snb.ch#USD_0d6cfaf1d11a41f8002581e0003ea07c"/>
<rdf:li rdf:resource="https://www.snb.ch#GBP_d101d729279f41cd002581df003e31f1"/>
<rdf:li rdf:resource="https://www.snb.ch#JPY_d101d729279f41cd002581df003e31f1"/>
<rdf:li rdf:resource="https://www.snb.ch#EUR_d101d729279f41cd002581df003e31f1"/>
<rdf:li rdf:resource="https://www.snb.ch#USD_d101d729279f41cd002581df003e31f1"/>
</rdf:Seq>
</items>
<dc:publisher>SNB</dc:publisher>
<dc:rights>Copyright © Schweizerische Nationalbank, Zürich (Schweiz) 2017</dc:rights>
<dcterms:license>https://www.snb.ch/de/srv/id/disclaimer</dcterms:license>
<dcterms:created>2017-11-28T07:50:22+01:00</dcterms:created>
</channel>
<item rdf:about="https://www.snb.ch#GBP_6ec827d359194a0a002581e5003df8a5">
<title>CH: 1.3081 CHF = 1 GBP 2017-11-27 Tägliche Kurse (11:00)</title>
<link>https://www.snb.ch</link>
<description>1 GBP = 1.3081 CHF (Tägliche Kurse (11:00); 2017-11-27T12:16:53.767+01:00)</description>
<dc:date>2018-01-03T12:16:53.767+01:00</dc:date>
<dc:language>de</dc:language>
<cb:statistics rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#Statistics"/>
<cb:country>CH</cb:country>
<cb:institutionAbbrev>SNB</cb:institutionAbbrev>
<cb:exchangeRate rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#ExchangeRate"/>
<cb:observation rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#Observation"/>
<cb:value>1.3081</cb:value>
<cb:unit>CHF</cb:unit>
<cb:decimals>4</cb:decimals>
</cb:observation>
<cb:baseCurrency>CHF</cb:baseCurrency>
<cb:targetCurrency>GBP</cb:targetCurrency>
<cb:rateType>Tägliche Kurse (11:00)</cb:rateType>
<cb:observationPeriod rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#ObservationPeriod"/>
<cb:frequency>daily</cb:frequency>
<cb:period>2017-11-27</cb:period>
</cb:observationPeriod>
</cb:exchangeRate>
</cb:statistics>
</item>
<item rdf:about="https://www.snb.ch#JPY_6ec827d359194a0a002581e5003df8a5">
<title>CH: 0.8813 CHF = 100 JPY 2017-11-27 Tägliche Kurse (11:00)</title>
<link>https://www.snb.ch</link>
<description>100 JPY = 0.8813 CHF (Tägliche Kurse (11:00); 2017-11-27T12:16:53.760+01:00)</description>
<dc:date>2018-01-03T12:16:53.760+01:00</dc:date>
<dc:language>de</dc:language>
<cb:statistics rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#Statistics"/>
<cb:country>CH</cb:country>
<cb:institutionAbbrev>SNB</cb:institutionAbbrev>
<cb:exchangeRate rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#ExchangeRate"/>
<cb:observation rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#Observation"/>
<cb:value>10000.8813</cb:value>
<cb:unit>CHF</cb:unit>
<cb:unit_mult>-2</cb:unit_mult>
<cb:decimals>4</cb:decimals>
</cb:observation>
<cb:baseCurrency>CHF</cb:baseCurrency>
<cb:targetCurrency>JPY</cb:targetCurrency>
<cb:rateType>Tägliche Kurse (11:00)</cb:rateType>
<cb:observationPeriod rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#ObservationPeriod"/>
<cb:frequency>daily</cb:frequency>
<cb:period>2017-11-27</cb:period>
</cb:observationPeriod>
</cb:exchangeRate>
</cb:statistics>
</item>
<item rdf:about="https://www.snb.ch#EUR_6ec827d359194a0a002581e5003df8a5">
<title>CH: 1.1697 CHF = 1 EUR 2017-11-27 Tägliche Kurse (11:00)</title>
<link>https://www.snb.ch</link>
<description>1 EUR = 1.1697 CHF (Tägliche Kurse (11:00); 2017-11-27T12:16:53.750+01:00)</description>
<dc:date>2018-01-03T12:16:53.750+01:00</dc:date>
<dc:language>de</dc:language>
<cb:statistics rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#Statistics"/>
<cb:country>CH</cb:country>
<cb:institutionAbbrev>SNB</cb:institutionAbbrev>
<cb:exchangeRate rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#ExchangeRate"/>
<cb:observation rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#Observation"/>
<cb:value>1.1697</cb:value>
<cb:unit>CHF</cb:unit>
<cb:decimals>4</cb:decimals>
</cb:observation>
<cb:baseCurrency>CHF</cb:baseCurrency>
<cb:targetCurrency>EUR</cb:targetCurrency>
<cb:rateType>Tägliche Kurse (11:00)</cb:rateType>
<cb:observationPeriod rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#ObservationPeriod"/>
<cb:frequency>daily</cb:frequency>
<cb:period>2017-11-27</cb:period>
</cb:observationPeriod>
</cb:exchangeRate>
</cb:statistics>
</item>
<item rdf:about="https://www.snb.ch#USD_6ec827d359194a0a002581e5003df8a5">
<title>CH: 0.9803 CHF = 1 USD 2017-11-27 Tägliche Kurse (11:00)</title>
<link>https://www.snb.ch</link>
<description>1 USD = 0.9803 CHF (Tägliche Kurse (11:00); 2017-11-27T12:16:53.737+01:00)</description>
<dc:date>2018-01-03T12:16:53.737+01:00</dc:date>
<dc:language>de</dc:language>
<cb:statistics rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#Statistics"/>
<cb:country>CH</cb:country>
<cb:institutionAbbrev>SNB</cb:institutionAbbrev>
<cb:exchangeRate rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#ExchangeRate"/>
<cb:observation rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#Observation"/>
<cb:value>0.9803</cb:value>
<cb:unit>CHF</cb:unit>
<cb:decimals>4</cb:decimals>
</cb:observation>
<cb:baseCurrency>CHF</cb:baseCurrency>
<cb:targetCurrency>USD</cb:targetCurrency>
<cb:rateType>Tägliche Kurse (11:00)</cb:rateType>
<cb:observationPeriod rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#ObservationPeriod"/>
<cb:frequency>daily</cb:frequency>
<cb:period>2017-11-27</cb:period>
</cb:observationPeriod>
</cb:exchangeRate>
</cb:statistics>
</item>
<item rdf:about="https://www.snb.ch#GBP_f4a6fbc20fb0403d002581e2003e3d67">
<title>CH: 1.3072 CHF = 1 GBP 2017-11-24 Tägliche Kurse (11:00)</title>
<link>https://www.snb.ch</link>
<description>1 GBP = 1.3072 CHF (Tägliche Kurse (11:00); 2017-11-24T12:19:49.733+01:00)</description>
<dc:date>2017-11-24T12:19:49.733+01:00</dc:date>
<dc:language>de</dc:language>
<cb:statistics rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#Statistics"/>
<cb:country>CH</cb:country>
<cb:institutionAbbrev>SNB</cb:institutionAbbrev>
<cb:exchangeRate rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#ExchangeRate"/>
<cb:observation rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#Observation"/>
<cb:value>1.3072</cb:value>
<cb:unit>CHF</cb:unit>
<cb:decimals>4</cb:decimals>
</cb:observation>
<cb:baseCurrency>CHF</cb:baseCurrency>
<cb:targetCurrency>GBP</cb:targetCurrency>
<cb:rateType>Tägliche Kurse (11:00)</cb:rateType>
<cb:observationPeriod rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#ObservationPeriod"/>
<cb:frequency>daily</cb:frequency>
<cb:period>2017-11-24</cb:period>
</cb:observationPeriod>
</cb:exchangeRate>
</cb:statistics>
</item>
<item rdf:about="https://www.snb.ch#JPY_f4a6fbc20fb0403d002581e2003e3d67">
<title>CH: 0.8806 CHF = 100 JPY 2017-11-24 Tägliche Kurse (11:00)</title>
<link>https://www.snb.ch</link>
<description>100 JPY = 0.8806 CHF (Tägliche Kurse (11:00); 2017-11-24T12:19:49.717+01:00)</description>
<dc:date>2017-11-24T12:19:49.717+01:00</dc:date>
<dc:language>de</dc:language>
<cb:statistics rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#Statistics"/>
<cb:country>CH</cb:country>
<cb:institutionAbbrev>SNB</cb:institutionAbbrev>
<cb:exchangeRate rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#ExchangeRate"/>
<cb:observation rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#Observation"/>
<cb:value>0.8806</cb:value>
<cb:unit>CHF</cb:unit>
<cb:unit_mult>-2</cb:unit_mult>
<cb:decimals>4</cb:decimals>
</cb:observation>
<cb:baseCurrency>CHF</cb:baseCurrency>
<cb:targetCurrency>JPY</cb:targetCurrency>
<cb:rateType>Tägliche Kurse (11:00)</cb:rateType>
<cb:observationPeriod rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#ObservationPeriod"/>
<cb:frequency>daily</cb:frequency>
<cb:period>2017-11-24</cb:period>
</cb:observationPeriod>
</cb:exchangeRate>
</cb:statistics>
</item>
<item rdf:about="https://www.snb.ch#EUR_f4a6fbc20fb0403d002581e2003e3d67">
<title>CH: 1.1644 CHF = 1 EUR 2017-11-24 Tägliche Kurse (11:00)</title>
<link>https://www.snb.ch</link>
<description>1 EUR = 1.1644 CHF (Tägliche Kurse (11:00); 2017-11-24T12:19:49.710+01:00)</description>
<dc:date>2017-11-24T12:19:49.710+01:00</dc:date>
<dc:language>de</dc:language>
<cb:statistics rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#Statistics"/>
<cb:country>CH</cb:country>
<cb:institutionAbbrev>SNB</cb:institutionAbbrev>
<cb:exchangeRate rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#ExchangeRate"/>
<cb:observation rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#Observation"/>
<cb:value>1.1644</cb:value>
<cb:unit>CHF</cb:unit>
<cb:decimals>4</cb:decimals>
</cb:observation>
<cb:baseCurrency>CHF</cb:baseCurrency>
<cb:targetCurrency>EUR</cb:targetCurrency>
<cb:rateType>Tägliche Kurse (11:00)</cb:rateType>
<cb:observationPeriod rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#ObservationPeriod"/>
<cb:frequency>daily</cb:frequency>
<cb:period>2017-11-24</cb:period>
</cb:observationPeriod>
</cb:exchangeRate>
</cb:statistics>
</item>
<item rdf:about="https://www.snb.ch#USD_f4a6fbc20fb0403d002581e2003e3d67">
<title>CH: 0.9809 CHF = 1 USD 2017-11-24 Tägliche Kurse (11:00)</title>
<link>https://www.snb.ch</link>
<description>1 USD = 0.9809 CHF (Tägliche Kurse (11:00); 2017-11-24T12:19:49.703+01:00)</description>
<dc:date>2017-11-24T12:19:49.703+01:00</dc:date>
<dc:language>de</dc:language>
<cb:statistics rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#Statistics"/>
<cb:country>CH</cb:country>
<cb:institutionAbbrev>SNB</cb:institutionAbbrev>
<cb:exchangeRate rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#ExchangeRate"/>
<cb:observation rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#Observation"/>
<cb:value>0.9809</cb:value>
<cb:unit>CHF</cb:unit>
<cb:decimals>4</cb:decimals>
</cb:observation>
<cb:baseCurrency>CHF</cb:baseCurrency>
<cb:targetCurrency>USD</cb:targetCurrency>
<cb:rateType>Tägliche Kurse (11:00)</cb:rateType>
<cb:observationPeriod rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#ObservationPeriod"/>
<cb:frequency>daily</cb:frequency>
<cb:period>2017-11-24</cb:period>
</cb:observationPeriod>
</cb:exchangeRate>
</cb:statistics>
</item>
<item rdf:about="https://www.snb.ch#GBP_6568365cd292474b002581e1003fca55">
<title>CH: 1.3052 CHF = 1 GBP 2017-11-23 Tägliche Kurse (11:00)</title>
<link>https://www.snb.ch</link>
<description>1 GBP = 1.3052 CHF (Tägliche Kurse (11:00); 2017-11-23T12:36:46.040+01:00)</description>
<dc:date>2017-11-23T12:36:46.040+01:00</dc:date>
<dc:language>de</dc:language>
<cb:statistics rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#Statistics"/>
<cb:country>CH</cb:country>
<cb:institutionAbbrev>SNB</cb:institutionAbbrev>
<cb:exchangeRate rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#ExchangeRate"/>
<cb:observation rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#Observation"/>
<cb:value>1.3052</cb:value>
<cb:unit>CHF</cb:unit>
<cb:decimals>4</cb:decimals>
</cb:observation>
<cb:baseCurrency>CHF</cb:baseCurrency>
<cb:targetCurrency>GBP</cb:targetCurrency>
<cb:rateType>Tägliche Kurse (11:00)</cb:rateType>
<cb:observationPeriod rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#ObservationPeriod"/>
<cb:frequency>daily</cb:frequency>
<cb:period>2017-11-23</cb:period>
</cb:observationPeriod>
</cb:exchangeRate>
</cb:statistics>
</item>
<item rdf:about="https://www.snb.ch#JPY_6568365cd292474b002581e1003fca55">
<title>CH: 0.8816 CHF = 100 JPY 2017-11-23 Tägliche Kurse (11:00)</title>
<link>https://www.snb.ch</link>
<description>100 JPY = 0.8816 CHF (Tägliche Kurse (11:00); 2017-11-23T12:36:46.030+01:00)</description>
<dc:date>2017-11-23T12:36:46.030+01:00</dc:date>
<dc:language>de</dc:language>
<cb:statistics rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#Statistics"/>
<cb:country>CH</cb:country>
<cb:institutionAbbrev>SNB</cb:institutionAbbrev>
<cb:exchangeRate rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#ExchangeRate"/>
<cb:observation rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#Observation"/>
<cb:value>0.8816</cb:value>
<cb:unit>CHF</cb:unit>
<cb:unit_mult>-2</cb:unit_mult>
<cb:decimals>4</cb:decimals>
</cb:observation>
<cb:baseCurrency>CHF</cb:baseCurrency>
<cb:targetCurrency>JPY</cb:targetCurrency>
<cb:rateType>Tägliche Kurse (11:00)</cb:rateType>
<cb:observationPeriod rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#ObservationPeriod"/>
<cb:frequency>daily</cb:frequency>
<cb:period>2017-11-23</cb:period>
</cb:observationPeriod>
</cb:exchangeRate>
</cb:statistics>
</item>
<item rdf:about="https://www.snb.ch#EUR_6568365cd292474b002581e1003fca55">
<title>CH: 1.1617 CHF = 1 EUR 2017-11-23 Tägliche Kurse (11:00)</title>
<link>https://www.snb.ch</link>
<description>1 EUR = 1.1617 CHF (Tägliche Kurse (11:00); 2017-11-23T12:36:46.027+01:00)</description>
<dc:date>2017-11-23T12:36:46.027+01:00</dc:date>
<dc:language>de</dc:language>
<cb:statistics rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#Statistics"/>
<cb:country>CH</cb:country>
<cb:institutionAbbrev>SNB</cb:institutionAbbrev>
<cb:exchangeRate rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#ExchangeRate"/>
<cb:observation rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#Observation"/>
<cb:value>1.1617</cb:value>
<cb:unit>CHF</cb:unit>
<cb:decimals>4</cb:decimals>
</cb:observation>
<cb:baseCurrency>CHF</cb:baseCurrency>
<cb:targetCurrency>EUR</cb:targetCurrency>
<cb:rateType>Tägliche Kurse (11:00)</cb:rateType>
<cb:observationPeriod rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#ObservationPeriod"/>
<cb:frequency>daily</cb:frequency>
<cb:period>2017-11-23</cb:period>
</cb:observationPeriod>
</cb:exchangeRate>
</cb:statistics>
</item>
<item rdf:about="https://www.snb.ch#USD_6568365cd292474b002581e1003fca55">
<title>CH: 0.9811 CHF = 1 USD 2017-11-23 Tägliche Kurse (11:00)</title>
<link>https://www.snb.ch</link>
<description>1 USD = 0.9811 CHF (Tägliche Kurse (11:00); 2017-11-23T12:36:46.017+01:00)</description>
<dc:date>2017-11-23T12:36:46.017+01:00</dc:date>
<dc:language>de</dc:language>
<cb:statistics rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#Statistics"/>
<cb:country>CH</cb:country>
<cb:institutionAbbrev>SNB</cb:institutionAbbrev>
<cb:exchangeRate rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#ExchangeRate"/>
<cb:observation rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#Observation"/>
<cb:value>0.9811</cb:value>
<cb:unit>CHF</cb:unit>
<cb:decimals>4</cb:decimals>
</cb:observation>
<cb:baseCurrency>CHF</cb:baseCurrency>
<cb:targetCurrency>USD</cb:targetCurrency>
<cb:rateType>Tägliche Kurse (11:00)</cb:rateType>
<cb:observationPeriod rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#ObservationPeriod"/>
<cb:frequency>daily</cb:frequency>
<cb:period>2017-11-23</cb:period>
</cb:observationPeriod>
</cb:exchangeRate>
</cb:statistics>
</item>
<item rdf:about="https://www.snb.ch#GBP_0d6cfaf1d11a41f8002581e0003ea07c">
<title>CH: 1.3109 CHF = 1 GBP 2017-11-22 Tägliche Kurse (11:00)</title>
<link>https://www.snb.ch</link>
<description>1 GBP = 1.3109 CHF (Tägliche Kurse (11:00); 2017-11-22T12:24:04.110+01:00)</description>
<dc:date>2017-11-22T12:24:04.110+01:00</dc:date>
<dc:language>de</dc:language>
<cb:statistics rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#Statistics"/>
<cb:country>CH</cb:country>
<cb:institutionAbbrev>SNB</cb:institutionAbbrev>
<cb:exchangeRate rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#ExchangeRate"/>
<cb:observation rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#Observation"/>
<cb:value>1.3109</cb:value>
<cb:unit>CHF</cb:unit>
<cb:decimals>4</cb:decimals>
</cb:observation>
<cb:baseCurrency>CHF</cb:baseCurrency>
<cb:targetCurrency>GBP</cb:targetCurrency>
<cb:rateType>Tägliche Kurse (11:00)</cb:rateType>
<cb:observationPeriod rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#ObservationPeriod"/>
<cb:frequency>daily</cb:frequency>
<cb:period>2017-11-22</cb:period>
</cb:observationPeriod>
</cb:exchangeRate>
</cb:statistics>
</item>
<item rdf:about="https://www.snb.ch#JPY_0d6cfaf1d11a41f8002581e0003ea07c">
<title>CH: 0.8827 CHF = 100 JPY 2017-11-22 Tägliche Kurse (11:00)</title>
<link>https://www.snb.ch</link>
<description>100 JPY = 0.8827 CHF (Tägliche Kurse (11:00); 2017-11-22T12:24:04.103+01:00)</description>
<dc:date>2017-11-22T12:24:04.103+01:00</dc:date>
<dc:language>de</dc:language>
<cb:statistics rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#Statistics"/>
<cb:country>CH</cb:country>
<cb:institutionAbbrev>SNB</cb:institutionAbbrev>
<cb:exchangeRate rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#ExchangeRate"/>
<cb:observation rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#Observation"/>
<cb:value>0.8827</cb:value>
<cb:unit>CHF</cb:unit>
<cb:unit_mult>-2</cb:unit_mult>
<cb:decimals>4</cb:decimals>
</cb:observation>
<cb:baseCurrency>CHF</cb:baseCurrency>
<cb:targetCurrency>JPY</cb:targetCurrency>
<cb:rateType>Tägliche Kurse (11:00)</cb:rateType>
<cb:observationPeriod rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#ObservationPeriod"/>
<cb:frequency>daily</cb:frequency>
<cb:period>2017-11-22</cb:period>
</cb:observationPeriod>
</cb:exchangeRate>
</cb:statistics>
</item>
<item rdf:about="https://www.snb.ch#EUR_0d6cfaf1d11a41f8002581e0003ea07c">
<title>CH: 1.1633 CHF = 1 EUR 2017-11-22 Tägliche Kurse (11:00)</title>
<link>https://www.snb.ch</link>
<description>1 EUR = 1.1633 CHF (Tägliche Kurse (11:00); 2017-11-22T12:24:04.090+01:00)</description>
<dc:date>2017-11-22T12:24:04.090+01:00</dc:date>
<dc:language>de</dc:language>
<cb:statistics rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#Statistics"/>
<cb:country>CH</cb:country>
<cb:institutionAbbrev>SNB</cb:institutionAbbrev>
<cb:exchangeRate rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#ExchangeRate"/>
<cb:observation rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#Observation"/>
<cb:value>1.1633</cb:value>
<cb:unit>CHF</cb:unit>
<cb:decimals>4</cb:decimals>
</cb:observation>
<cb:baseCurrency>CHF</cb:baseCurrency>
<cb:targetCurrency>EUR</cb:targetCurrency>
<cb:rateType>Tägliche Kurse (11:00)</cb:rateType>
<cb:observationPeriod rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#ObservationPeriod"/>
<cb:frequency>daily</cb:frequency>
<cb:period>2017-11-22</cb:period>
</cb:observationPeriod>
</cb:exchangeRate>
</cb:statistics>
</item>
<item rdf:about="https://www.snb.ch#USD_0d6cfaf1d11a41f8002581e0003ea07c">
<title>CH: 0.9894 CHF = 1 USD 2017-11-22 Tägliche Kurse (11:00)</title>
<link>https://www.snb.ch</link>
<description>1 USD = 0.9894 CHF (Tägliche Kurse (11:00); 2017-11-22T12:24:04.083+01:00)</description>
<dc:date>2017-11-22T12:24:04.083+01:00</dc:date>
<dc:language>de</dc:language>
<cb:statistics rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#Statistics"/>
<cb:country>CH</cb:country>
<cb:institutionAbbrev>SNB</cb:institutionAbbrev>
<cb:exchangeRate rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#ExchangeRate"/>
<cb:observation rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#Observation"/>
<cb:value>0.9894</cb:value>
<cb:unit>CHF</cb:unit>
<cb:decimals>4</cb:decimals>
</cb:observation>
<cb:baseCurrency>CHF</cb:baseCurrency>
<cb:targetCurrency>USD</cb:targetCurrency>
<cb:rateType>Tägliche Kurse (11:00)</cb:rateType>
<cb:observationPeriod rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#ObservationPeriod"/>
<cb:frequency>daily</cb:frequency>
<cb:period>2017-11-22</cb:period>
</cb:observationPeriod>
</cb:exchangeRate>
</cb:statistics>
</item>
<item rdf:about="https://www.snb.ch#GBP_d101d729279f41cd002581df003e31f1">
<title>CH: 1.3151 CHF = 1 GBP 2017-11-21 Tägliche Kurse (11:00)</title>
<link>https://www.snb.ch</link>
<description>1 GBP = 1.3151 CHF (Tägliche Kurse (11:00); 2017-11-21T12:19:20.370+01:00)</description>
<dc:date>2017-11-21T12:19:20.370+01:00</dc:date>
<dc:language>de</dc:language>
<cb:statistics rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#Statistics"/>
<cb:country>CH</cb:country>
<cb:institutionAbbrev>SNB</cb:institutionAbbrev>
<cb:exchangeRate rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#ExchangeRate"/>
<cb:observation rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#Observation"/>
<cb:value>1.3151</cb:value>
<cb:unit>CHF</cb:unit>
<cb:decimals>4</cb:decimals>
</cb:observation>
<cb:baseCurrency>CHF</cb:baseCurrency>
<cb:targetCurrency>GBP</cb:targetCurrency>
<cb:rateType>Tägliche Kurse (11:00)</cb:rateType>
<cb:observationPeriod rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#ObservationPeriod"/>
<cb:frequency>daily</cb:frequency>
<cb:period>2017-11-21</cb:period>
</cb:observationPeriod>
</cb:exchangeRate>
</cb:statistics>
</item>
<item rdf:about="https://www.snb.ch#JPY_d101d729279f41cd002581df003e31f1">
<title>CH: 0.8832 CHF = 100 JPY 2017-11-21 Tägliche Kurse (11:00)</title>
<link>https://www.snb.ch</link>
<description>100 JPY = 0.8832 CHF (Tägliche Kurse (11:00); 2017-11-21T12:19:20.363+01:00)</description>
<dc:date>2017-11-21T12:19:20.363+01:00</dc:date>
<dc:language>de</dc:language>
<cb:statistics rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#Statistics"/>
<cb:country>CH</cb:country>
<cb:institutionAbbrev>SNB</cb:institutionAbbrev>
<cb:exchangeRate rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#ExchangeRate"/>
<cb:observation rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#Observation"/>
<cb:value>0.8832</cb:value>
<cb:unit>CHF</cb:unit>
<cb:unit_mult>-2</cb:unit_mult>
<cb:decimals>4</cb:decimals>
</cb:observation>
<cb:baseCurrency>CHF</cb:baseCurrency>
<cb:targetCurrency>JPY</cb:targetCurrency>
<cb:rateType>Tägliche Kurse (11:00)</cb:rateType>
<cb:observationPeriod rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#ObservationPeriod"/>
<cb:frequency>daily</cb:frequency>
<cb:period>2017-11-21</cb:period>
</cb:observationPeriod>
</cb:exchangeRate>
</cb:statistics>
</item>
<item rdf:about="https://www.snb.ch#EUR_d101d729279f41cd002581df003e31f1">
<title>CH: 1.1647 CHF = 1 EUR 2017-11-21 Tägliche Kurse (11:00)</title>
<link>https://www.snb.ch</link>
<description>1 EUR = 1.1647 CHF (Tägliche Kurse (11:00); 2017-11-21T12:19:20.360+01:00)</description>
<dc:date>2017-11-21T12:19:20.360+01:00</dc:date>
<dc:language>de</dc:language>
<cb:statistics rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#Statistics"/>
<cb:country>CH</cb:country>
<cb:institutionAbbrev>SNB</cb:institutionAbbrev>
<cb:exchangeRate rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#ExchangeRate"/>
<cb:observation rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#Observation"/>
<cb:value>1.1647</cb:value>
<cb:unit>CHF</cb:unit>
<cb:decimals>4</cb:decimals>
</cb:observation>
<cb:baseCurrency>CHF</cb:baseCurrency>
<cb:targetCurrency>EUR</cb:targetCurrency>
<cb:rateType>Tägliche Kurse (11:00)</cb:rateType>
<cb:observationPeriod rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#ObservationPeriod"/>
<cb:frequency>daily</cb:frequency>
<cb:period>2017-11-21</cb:period>
</cb:observationPeriod>
</cb:exchangeRate>
</cb:statistics>
</item>
<item rdf:about="https://www.snb.ch#USD_d101d729279f41cd002581df003e31f1">
<title>CH: 0.9930 CHF = 1 USD 2017-11-21 Tägliche Kurse (11:00)</title>
<link>https://www.snb.ch</link>
<description>1 USD = 0.9930 CHF (Tägliche Kurse (11:00); 2017-11-21T12:19:20.343+01:00)</description>
<dc:date>2017-11-21T12:19:20.343+01:00</dc:date>
<dc:language>de</dc:language>
<cb:statistics rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#Statistics"/>
<cb:country>CH</cb:country>
<cb:institutionAbbrev>SNB</cb:institutionAbbrev>
<cb:exchangeRate rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#ExchangeRate"/>
<cb:observation rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#Observation"/>
<cb:value>0.9930</cb:value>
<cb:unit>CHF</cb:unit>
<cb:decimals>4</cb:decimals>
</cb:observation>
<cb:baseCurrency>CHF</cb:baseCurrency>
<cb:targetCurrency>USD</cb:targetCurrency>
<cb:rateType>Tägliche Kurse (11:00)</cb:rateType>
<cb:observationPeriod rdf:parseType="Resource">
<rdf:type rdf:resource="http://www.cbwiki.net/wiki/index.php/RSS-CB_1.2_RDF_Schema#ObservationPeriod"/>
<cb:frequency>daily</cb:frequency>
<cb:period>2017-11-21</cb:period>
</cb:observationPeriod>
</cb:exchangeRate>
</cb:statistics>
</item>
</rdf:RDF>

View File

@ -2,7 +2,7 @@ from decimal import Decimal
from django.core.validators import MinValueValidator
from django.db import models
from django.contrib.auth.models import User
import datetime
from django.utils import timezone
class Option(models.Model):
@ -28,14 +28,6 @@ class ArticleStatus(models.Model):
return self.name
class ExchangeRate(models.Model):
name = models.CharField(max_length=200, unique=True)
exchange_rate_to_chf = models.FloatField(max_length=5)
def __str__(self):
return self.name
# Create your models here.
class Category(models.Model):
name = models.CharField(max_length=200, unique=True)
@ -94,7 +86,7 @@ class Order(models.Model):
user = models.ForeignKey(User, on_delete=models.CASCADE)
article = models.ManyToManyField(Article, through='OrderPosition')
status = models.ForeignKey(OrderStatus)
date = models.DateTimeField(default=datetime.datetime.now())
date = models.DateTimeField(default=timezone.now)
class OrderPosition(models.Model):