Added VMTemplate model

This commit is contained in:
M.Ravi 2017-07-26 19:38:38 +02:00
parent a05b5b6918
commit c92960a3e6

View file

@ -15,6 +15,7 @@ class BetaAccessVMType(models.Model):
class BetaAccess(models.Model):
email = models.CharField(max_length=250)
name = models.CharField(max_length=250)
# vm = models.ForeignKey(BetaAccessVM)
def __str__(self):
@ -48,3 +49,13 @@ class BetaAccessVM(models.Model):
amount=vm[VM_AMOUNT], type=vm_type))
return created_vms
class VMTemplate(models.Model):
name = models.CharField(max_length=50)
opennebula_vm_id = models.IntegerField()
@classmethod
def create(cls, name, opennebula_vm_id):
vm_template = cls(name=name, opennebula_vm_id=opennebula_vm_id)
return vm_template