Hosts have groups.

This commit is contained in:
Michael DeHaan
2013-03-15 11:26:32 -04:00
parent 4d20258a7c
commit b3c21db999
2 changed files with 245 additions and 1 deletions

View File

@@ -84,7 +84,6 @@ class Host(CommonModel):
app_label = 'main'
inventory = models.ForeignKey('Inventory', null=True, on_delete=SET_NULL, related_name='hosts')
class Group(CommonModel):
'''
@@ -96,6 +95,7 @@ class Group(CommonModel):
inventory = models.ForeignKey('Inventory', null=True, on_delete=SET_NULL, related_name='groups')
parents = models.ManyToManyField('self', related_name='children', blank=True)
hosts = models.ManyToManyField('Host', related_name='groups', blank=True)
# FIXME: audit nullables
# FIXME: audit cascades