set default for omf_friendly, move get_default_serviceclass outside of model for compaitibility with migrations
diff --git a/planetstack/core/models/serviceclass.py b/planetstack/core/models/serviceclass.py
index 3b6ee82..c339b67 100644
--- a/planetstack/core/models/serviceclass.py
+++ b/planetstack/core/models/serviceclass.py
@@ -4,7 +4,11 @@
from core.models import Site
from core.models import Deployment
-# Create your models here.
+def get_default_serviceclass():
+ try:
+ return ServiceClass.objects.get(name="Best Effort")
+ except ServiceClass.DoesNotExist:
+ return None
class ServiceClass(PlCoreBase):
name = models.CharField(max_length=32)
@@ -20,13 +24,6 @@
def __unicode__(self): return u'%s' % (self.name)
- @staticmethod
- def get_default():
- try:
- return ServiceClass.objects.get(name="Best Effort")
- except ServiceClass.DoesNotExist:
- return None
-
def save_by_user(self, user, *args, **kwds):
if self.can_update(user):
super(ServiceClass, self).save(*args, **kwds)