Clean-up intiail commit for Host filter / DynamicInventory

This commit is contained in:
Wayne Witzel III
2017-04-24 15:45:12 -04:00
parent 932f53b2ea
commit 17e9b3057e
8 changed files with 309 additions and 214 deletions

View File

@@ -20,7 +20,11 @@ from django.utils.timezone import now
# AWX
from awx.api.versioning import reverse
from awx.main.constants import CLOUD_PROVIDERS
from awx.main.fields import ImplicitRoleField, JSONBField
from awx.main.fields import (
ImplicitRoleField,
JSONBField,
DynamicFilterField,
)
from awx.main.managers import HostManager
from awx.main.models.base import * # noqa
from awx.main.models.unified_jobs import * # noqa
@@ -99,6 +103,13 @@ class Inventory(CommonModelNameNotUnique, ResourceMixin):
editable=False,
help_text=_('Number of external inventory sources in this inventory with failures.'),
)
host_filter = DynamicFilterField(
blank=True,
null=True,
default=None,
help_text=_('Filter that will be applied to the hosts of this inventory.'),
)
admin_role = ImplicitRoleField(
parent_role='organization.admin_role',
)