Remove vms field from vmhost

Signed-off-by: Nico Schottelius <nico@nico-notebook.schottelius.org>
This commit is contained in:
Nico Schottelius 2020-03-05 14:58:45 +01:00
commit 139aca6a61
3 changed files with 23 additions and 5 deletions

View file

@ -41,11 +41,9 @@ class VMHost(models.Model):
max_length=32, choices=STATUS_CHOICES, default=STATUS_DEFAULT
)
# List of VMs running on this host
vms = models.TextField(default='')
def get_vms(self):
return self.vms.split(',')
@property
def vms(self):
return VMProduct.objects.filter(vmhost=self)
class VMProduct(Product):