From fded4a80f93685704d002ee1d1440729623e8050 Mon Sep 17 00:00:00 2001 From: Andreas Zweili Date: Fri, 2 Mar 2018 14:54:54 +0100 Subject: [PATCH] display the exchangerate with name and value --- django/didgeridoo/currencies/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/django/didgeridoo/currencies/models.py b/django/didgeridoo/currencies/models.py index 3331c3f..f698a79 100644 --- a/django/didgeridoo/currencies/models.py +++ b/django/didgeridoo/currencies/models.py @@ -23,7 +23,7 @@ class ExchangeRate(models.Model): def exchange(_currency_id, _base_currency): rate = ExchangeRate.objects.filter(name=_currency_id).latest('date') - return round(rate.exchange_rate_to_chf * _base_currency,2) + return round(rate.exchange_rate_to_chf * _base_currency, 2) def __str__(self): - return str(self.name) + return '{} {}'.format(self.exchange_rate_to_chf, self.name)