add ManyToMany for (Image, Deployment)
authorScott Baker <smbaker@gmail.com>
Mon, 22 Dec 2014 23:59:05 +0000 (15:59 -0800)
committerScott Baker <smbaker@gmail.com>
Mon, 22 Dec 2014 23:59:05 +0000 (15:59 -0800)
planetstack/core/models/image.py

index 4399c60..0bca22f 100644 (file)
@@ -10,6 +10,7 @@ class Image(PlCoreBase):
     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")
+    deployments = models.ManyToManyField('Deployment', through='ImageDeployments', blank=True, help_text="Select which images should be instantiated on this deployment", related_name='images')
 
     def __unicode__(self):  return u'%s' % (self.name)