set default for omf_friendly, move get_default_serviceclass outside of model for compaitibility with migrations
diff --git a/planetstack/core/models/slice.py b/planetstack/core/models/slice.py
index 0ecc99d..1023856 100644
--- a/planetstack/core/models/slice.py
+++ b/planetstack/core/models/slice.py
@@ -7,6 +7,7 @@
from core.models import Role
from core.models import Deployment
from core.models import ServiceClass
+from core.models.serviceclass import get_default_serviceclass
from core.models import Tag
from django.contrib.contenttypes import generic
from core.models import Service
@@ -18,18 +19,18 @@
class Slice(PlCoreBase):
name = models.CharField(unique=True, help_text="The Name of the Slice", max_length=80)
enabled = models.BooleanField(default=True, help_text="Status for this Slice")
- omf_friendly = models.BooleanField()
+ omf_friendly = models.BooleanField(default=False)
description=models.TextField(blank=True,help_text="High level description of the slice and expected activities", max_length=1024)
slice_url = models.URLField(blank=True, max_length=512)
site = models.ForeignKey(Site, related_name='slices', help_text="The Site this Slice belongs to")
- max_slivers = models.IntegerField(default=10)
+ max_slivers = models.IntegerField(default=10)
imagePreference = models.CharField(default="Ubuntu 12.04 LTS", null=True, blank=True, max_length=256)
service = models.ForeignKey(Service, related_name='service', null=True, blank=True)
network = models.CharField(default="Private Only",null=True, blank=True, max_length=256)
mountDataSets = models.CharField(default="GenBank",null=True, blank=True, max_length=256)
tags = generic.GenericRelation(Tag)
- serviceClass = models.ForeignKey(ServiceClass, related_name = "slices", null=True, default=ServiceClass.get_default)
+ serviceClass = models.ForeignKey(ServiceClass, related_name = "slices", null=True, default=get_default_serviceclass)
creator = models.ForeignKey(User, related_name='slices', blank=True, null=True)
def __unicode__(self): return u'%s' % (self.name)