2 from django.db import models
3 from core.models import PlCoreBase
4 from core.models import Deployment
6 # Create your models here.
8 class Image(PlCoreBase):
9 name = models.CharField(max_length=256, unique=True)
10 disk_format = models.CharField(max_length=256)
11 container_format = models.CharField(max_length=256)
12 path = models.CharField(max_length=256, null=True, blank=True, help_text="Path to image on local disk")
14 def __unicode__(self): return u'%s' % (self.name)
16 class ImageDeployments(PlCoreBase):
17 image = models.ForeignKey(Image)
18 deployment = models.ForeignKey(Deployment)
19 glance_image_id = models.CharField(null=True, blank=True, max_length=200, help_text="Glance image id")
21 def __unicode__(self): return u'%s %s' % (self.image, self.deployment)