Added inventory tree view for AC-360.

This commit is contained in:
Chris Church
2013-08-26 12:57:41 -04:00
parent e343c9386d
commit 2bb5374685
14 changed files with 88 additions and 10 deletions

View File

@@ -216,6 +216,11 @@ class Inventory(CommonModel):
self.has_active_failures = has_active_failures
self.save()
@property
def root_groups(self):
group_pks = self.groups.values_list('pk', flat=True)
return self.groups.exclude(parents__pk__in=group_pks).distinct()
class Host(CommonModelNameNotUnique):
'''
A managed node