Add Inventory.kind field

This commit is contained in:
Wayne Witzel III
2017-04-28 11:48:24 -04:00
parent a45d41b379
commit 8a599d9754
3 changed files with 30 additions and 12 deletions

View File

@@ -46,6 +46,11 @@ class Inventory(CommonModelNameNotUnique, ResourceMixin):
an inventory source contains lists and hosts.
'''
KIND_CHOICES = [
('standard', _('Hosts have a direct link to this inventory.')),
('dynamic', _('Hosts for inventory generated using the host_filter property.')),
]
class Meta:
app_label = 'main'
verbose_name_plural = _('inventories')
@@ -103,6 +108,13 @@ class Inventory(CommonModelNameNotUnique, ResourceMixin):
editable=False,
help_text=_('Number of external inventory sources in this inventory with failures.'),
)
kind = models.CharField(
max_length=32,
choices=KIND_CHOICES,
blank=False,
default='standard',
help_text=_('Kind of inventory being represented.'),
)
host_filter = DynamicFilterField(
blank=True,
null=True,