forked from uncloud/uncloud
Revert "Commit WIP changes for /order, if needed at any point"
This reverts commit 83794a1781a1b84506100b39a6997882c654b4f3.
This commit is contained in:
parent
38d3a3a5d3
commit
0e28e50bac
4 changed files with 56 additions and 60 deletions
|
|
@ -1,10 +1,9 @@
|
|||
import uuid
|
||||
|
||||
from django.db import models
|
||||
from django.contrib.auth import get_user_model
|
||||
import uuid
|
||||
|
||||
import uncloud_pay.models as paymodels
|
||||
import uncloud_pay.helpers as payhelpers
|
||||
from uncloud_pay.models import Product, RecurringPeriod
|
||||
import uncloud_pay.models as pay_models
|
||||
|
||||
|
||||
class VMHost(models.Model):
|
||||
|
|
@ -34,7 +33,7 @@ class VMHost(models.Model):
|
|||
)
|
||||
|
||||
|
||||
class VMProduct(payhelpers.Product):
|
||||
class VMProduct(Product):
|
||||
vmhost = models.ForeignKey(VMHost,
|
||||
on_delete=models.CASCADE,
|
||||
editable=False,
|
||||
|
|
@ -46,8 +45,8 @@ class VMProduct(payhelpers.Product):
|
|||
ram_in_gb = models.FloatField()
|
||||
|
||||
@property
|
||||
def recurring_price(self, recurring_period=paymodels.RecurringPeriod.PER_MONTH):
|
||||
if recurring_period == paymodels.RecurringPeriod.PER_MONTH:
|
||||
def recurring_price(self, recurring_period=RecurringPeriod.PER_MONTH):
|
||||
if recurring_period == RecurringPeriod.PER_MONTH:
|
||||
# TODO: move magic numbers in variables
|
||||
return self.cores * 3 + self.ram_in_gb * 2
|
||||
else:
|
||||
|
|
@ -80,7 +79,7 @@ class VMNetworkCard(models.Model):
|
|||
mac_address = models.IntegerField()
|
||||
|
||||
|
||||
class VMSnapshotProduct(payhelpers.Product):
|
||||
class VMSnapshotProduct(Product):
|
||||
price_per_gb_ssd = 0.35
|
||||
price_per_gb_hdd = 1.5/100
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue