From 28de423a1475f1fc4f167311be292a4ab41d34eb Mon Sep 17 00:00:00 2001 From: PCoder Date: Fri, 6 Apr 2018 00:51:44 +0200 Subject: [PATCH] Add VMPricing model --- datacenterlight/models.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/datacenterlight/models.py b/datacenterlight/models.py index 6fcf24a9..01ddfdcf 100644 --- a/datacenterlight/models.py +++ b/datacenterlight/models.py @@ -12,6 +12,19 @@ class VMTemplate(models.Model): return vm_template +class VMPricing(models.Model): + name = models.CharField(max_length=255, unique=True) + vat_inclusive = models.BooleanField(default=True) + vat_percentage = models.DecimalField(decimal_places=2, blank=True) + cores_unit_price = models.DecimalField(decimal_places=2, default=0) + ram_unit_price = models.DecimalField(decimal_places=2, default= 0) + ssd_unit_price = models.DecimalField(decimal_places=2, default=0) + hdd_unit_price = models.DecimalField(decimal_places=2, default=0) + + def __str__(self): + return self.name + + class StripePlan(models.Model): """ A model to store Data Center Light's created Stripe plans