blob: 27b2642d7881b7d63c5dcbe9b7693d0f36ce555b [file] [log] [blame]
Scott Baker37b47902014-09-02 14:37:41 -07001import os
2import socket
3from django.db import models
Scott Baker7a61dc42014-09-02 17:08:20 -07004from core.models import PlCoreBase, Deployment
Scott Baker37b47902014-09-02 14:37:41 -07005from django.contrib.contenttypes.models import ContentType
6from django.contrib.contenttypes import generic
7
8class Flavor(PlCoreBase):
9 name = models.CharField(max_length=32, help_text="name of this flavor, as displayed to users")
10 description = models.CharField(max_length=1024, blank=True, null=True)
11 flavor = models.CharField(max_length=32, help_text="flavor string used to configure deployments")
12 deployments = models.ManyToManyField(Deployment, blank=True, related_name="flavors")
13 order = models.IntegerField(default=0, help_text="used to order flavors when displayed in a list")
14 default = models.BooleanField(default=False, help_text="make this a default flavor to use when creating new instances")
15
16 class Meta:
17 app_label = "core"
18 ordering = ('order', 'name')
19
20 def __unicode__(self): return u'%s' % (self.name)
21
Scott Baker37b47902014-09-02 14:37:41 -070022""" FlavorParameterType and FlavorParameter are below for completeness sake,
23 waiting for the day we might want to add parameters to flavors.
24
25class FlavorParameterType(PlCoreBase):
26 name = models.SlugField(help_text="The name of this parameter", max_length=128)
27 description = models.CharField(max_length=1024)
28
29 def __unicode__(self): return u'%s' % (self.name)
30
31class FlavorParameter(PlCoreBase):
32 parameter = models.ForeignKey(FlavorParameterType, related_name="parameters", help_text="The type of the parameter")
33 value = models.CharField(help_text="The value of this parameter", max_length=1024)
34
35 flavor = models.ForeignKey(Flavor)
36
37 def __unicode__(self):
38 return self.parameter.name
39
40"""
41