From ec753eb0d59887f16cd6d9b728dc86a3a5df147c Mon Sep 17 00:00:00 2001 From: PCoder Date: Mon, 16 Apr 2018 00:50:34 +0200 Subject: [PATCH] Improve string representation of VMPricing --- datacenterlight/models.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/datacenterlight/models.py b/datacenterlight/models.py index cddab497..eceb7617 100644 --- a/datacenterlight/models.py +++ b/datacenterlight/models.py @@ -36,13 +36,13 @@ class VMPricing(models.Model): ) def __str__(self): - return self.name + '-' + ' - '.join([ - '{}/Core'.format(self.cores_unit_price), - '{}/GB RAM'.format(self.ram_unit_price), - '{}/GB SSD'.format(self.ssd_unit_price), - '{}/GB HDD'.format(self.hdd_unit_price), - '{}% VAT'.format(self.vat_percentage) - if not self.vat_inclusive else 'NO_VAT', ] + return self.name + ' => ' + ' - '.join([ + '{}/Core'.format(self.cores_unit_price.normalize()), + '{}/GB RAM'.format(self.ram_unit_price.normalize()), + '{}/GB SSD'.format(self.ssd_unit_price.normalize()), + '{}/GB HDD'.format(self.hdd_unit_price.normalize()), + '{}% VAT'.format(self.vat_percentage.normalize()) + if not self.vat_inclusive else 'VAT-Incl', ] ) @classmethod