X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=planetstack%2Fcore%2Fmodels%2Fimage.py;h=db01e1b94523483b928c66767011f8e8c13d3e33;hb=bf39d9fcc245717369dc938fc47db69be6e4ac08;hp=b4803e2a0ca93351fc43366b9e873b4c75bb4d39;hpb=09fad0257209bde94b5ec38da63d7583f7f632be;p=plstackapi.git diff --git a/planetstack/core/models/image.py b/planetstack/core/models/image.py index b4803e2..db01e1b 100644 --- a/planetstack/core/models/image.py +++ b/planetstack/core/models/image.py @@ -1,13 +1,23 @@ import os from django.db import models from core.models import PlCoreBase +from core.models import Deployment # Create your models here. class Image(PlCoreBase): - image_id = models.CharField(max_length=256, unique=True) name = models.CharField(max_length=256, unique=True) disk_format = models.CharField(max_length=256) container_format = models.CharField(max_length=256) + path = models.CharField(max_length=256, null=True, blank=True, help_text="Path to image on local disk") def __unicode__(self): return u'%s' % (self.name) + +class ImageDeployments(PlCoreBase): + image = models.ForeignKey(Image) + deployment = models.ForeignKey(Deployment) + glance_image_id = models.CharField(null=True, blank=True, max_length=200, help_text="Glance image id") + + def __unicode__(self): return u'%s %s' % (self.image, self.deployment) + +