Siobhan Tully | 4bc09f2 | 2013-04-10 21:15:21 -0400 | [diff] [blame] | 1 | import os |
| 2 | from django.db import models |
| 3 | from plstackapi.core.models import PlCoreBase |
| 4 | from plstackapi.core.models import Flavor |
| 5 | from plstackapi.core.models import Image |
| 6 | from plstackapi.core.models import Key |
| 7 | from plstackapi.core.models import Slice |
| 8 | from plstackapi.core.models import Node |
| 9 | from plstackapi.core.models import Site |
| 10 | from plstackapi.core.models import DeploymentNetwork |
| 11 | from plstackapi.openstack.driver import OpenStackDriver |
| 12 | |
| 13 | # Create your models here. |
| 14 | class Sliver(PlCoreBase): |
| 15 | instance_id = models.CharField(max_length=200, help_text="Nova instance id") |
| 16 | name = models.CharField(max_length=200, help_text="Sliver name") |
Tony Mack | 771f4b9 | 2013-04-12 01:49:57 -0400 | [diff] [blame] | 17 | flavor = models.ForeignKey(Flavor, related_name='slivers') |
| 18 | image = models.ForeignKey(Image, related_name='slivers') |
| 19 | key = models.ForeignKey(Key, related_name='slivers') |
| 20 | slice = models.ForeignKey(Slice, related_name='slivers') |
| 21 | node = models.ForeignKey(Node, related_name='slivers') |
| 22 | site = models.ForeignKey(Site, related_name='slivers') |
Siobhan Tully | 4bc09f2 | 2013-04-10 21:15:21 -0400 | [diff] [blame] | 23 | deploymentNetwork = models.ForeignKey(DeploymentNetwork, related_name='sliver_deploymentNetwork') |
| 24 | |
Tony Mack | 29c287f | 2013-04-11 21:07:16 -0400 | [diff] [blame] | 25 | def __unicode__(self): return u'%s::%s' % (self.slice, self.deploymentNetwork) |
Siobhan Tully | 4bc09f2 | 2013-04-10 21:15:21 -0400 | [diff] [blame] | 26 | |