add all instances to special tower instance group

* All instances except isolated instances
* Also, prevent any tower attributes from being modified via the API
This commit is contained in:
chris meyers
2018-03-28 09:10:39 -04:00
parent ae5d17d151
commit 838b723c73
7 changed files with 56 additions and 12 deletions

View File

@@ -113,6 +113,9 @@ class InstanceManager(models.Manager):
# NOTE: TODO: Likely to repurpose this once standalone ramparts are a thing
return "tower"
def all_non_isolated(self):
return self.filter(rampart_groups__controller__isnull=True).distinct()
class InstanceGroupManager(models.Manager):
"""A custom manager class for the Instance model.