Adjusted modeling of Service, Slice and Tags. Added RequestRouter starter App. Modified Admin.py of core apps for new relationships. Modified the initial_data for new roles, and deprecated ForeignKey relationships.
diff --git a/planetstack/core/models/singletonmodel.py b/planetstack/core/models/singletonmodel.py
new file mode 100644
index 0000000..4ab6f6e
--- /dev/null
+++ b/planetstack/core/models/singletonmodel.py
@@ -0,0 +1,16 @@
+from django.db import models
+
+class SingletonModel(models.Model):
+ class Meta:
+ abstract = True
+
+ def save(self, *args, **kwargs):
+ self.__class__.objects.exclude(id=self.id).delete()
+ super(SingletonModel, self).save(*args, **kwargs)
+
+ @classmethod
+ def load(cls):
+ try:
+ return cls.objects.get()
+ except cls.DoesNotExist:
+ return cls()