forked from uncloud/uncloud
++update
Signed-off-by: Nico Schottelius <nico@nico-notebook.schottelius.org>
This commit is contained in:
parent
bd6008462d
commit
288a65f219
5 changed files with 83 additions and 9 deletions
|
|
@ -32,13 +32,7 @@ class VMHost(models.Model):
|
|||
)
|
||||
|
||||
|
||||
class VMProduct(models.Model):
|
||||
uuid = models.UUIDField(primary_key=True,
|
||||
default=uuid.uuid4,
|
||||
editable=False)
|
||||
owner = models.ForeignKey(get_user_model(),
|
||||
on_delete=models.CASCADE,
|
||||
editable=False)
|
||||
class VMProduct(Product):
|
||||
vmhost = models.ForeignKey(VMHost,
|
||||
on_delete=models.CASCADE,
|
||||
editable=False,
|
||||
|
|
@ -72,8 +66,12 @@ class OperatingSystemDisk(VMDiskProduct):
|
|||
|
||||
class VMNetworkCard(models.Model):
|
||||
vm = models.ForeignKey(VMProduct, on_delete=models.CASCADE)
|
||||
|
||||
mac_address = models.IntegerField()
|
||||
|
||||
ip_address = models.GenericIPAddressField(blank=True,
|
||||
null=True)
|
||||
|
||||
|
||||
class VMSnapshotProduct(Product):
|
||||
price_per_gb_ssd = 0.35
|
||||
|
|
@ -83,7 +81,8 @@ class VMSnapshotProduct(Product):
|
|||
gb_ssd = models.FloatField(editable=False)
|
||||
gb_hdd = models.FloatField(editable=False)
|
||||
|
||||
vm_uuid = models.UUIDField()
|
||||
vm = models.ForeignKey(VMProduct, on_delete=models.CASCADE)
|
||||
#vm_uuid = models.UUIDField()
|
||||
|
||||
# Need to setup recurring_price and one_time_price and recurring period
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue