mirror of
https://github.com/ansible/awx.git
synced 2026-03-20 18:37:39 -02:30
Added inventory to admin.
This commit is contained in:
@@ -5,5 +5,13 @@ from lib.main.models import *
|
|||||||
class OrganizationAdmin(admin.ModelAdmin):
|
class OrganizationAdmin(admin.ModelAdmin):
|
||||||
|
|
||||||
list_display = ('name', 'description', 'active')
|
list_display = ('name', 'description', 'active')
|
||||||
|
filter_horizontal = ('users', 'admins', 'projects')
|
||||||
|
|
||||||
|
class InventoryAdmin(admin.ModelAdmin):
|
||||||
|
|
||||||
|
list_display = ('name', 'description', 'active')
|
||||||
|
|
||||||
|
# FIXME: Add the rest of the models...
|
||||||
|
|
||||||
admin.site.register(Organization, OrganizationAdmin)
|
admin.site.register(Organization, OrganizationAdmin)
|
||||||
|
admin.site.register(Inventory, InventoryAdmin)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
from django.db import models
|
from django.db import models
|
||||||
from django.db.models import CASCADE, SET_NULL, PROTECT
|
from django.db.models import CASCADE, SET_NULL, PROTECT
|
||||||
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
# TODO: jobs and events model TBD
|
# TODO: jobs and events model TBD
|
||||||
# TODO: reporting model TBD
|
# TODO: reporting model TBD
|
||||||
@@ -64,6 +65,7 @@ class Inventory(CommonModel):
|
|||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
app_label = 'main'
|
app_label = 'main'
|
||||||
|
verbose_name_plural = _('inventories')
|
||||||
|
|
||||||
organization = models.ForeignKey(Organization, null=True, on_delete=SET_NULL, related_name='inventories')
|
organization = models.ForeignKey(Organization, null=True, on_delete=SET_NULL, related_name='inventories')
|
||||||
|
|
||||||
@@ -99,6 +101,7 @@ class VariableData(CommonModel):
|
|||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
app_label = 'main'
|
app_label = 'main'
|
||||||
|
verbose_name_plural = _('variable data')
|
||||||
|
|
||||||
host = models.ForeignKey('Host', null=True, default=None, blank=True, on_delete=CASCADE, related_name='variable_data')
|
host = models.ForeignKey('Host', null=True, default=None, blank=True, on_delete=CASCADE, related_name='variable_data')
|
||||||
group = models.ForeignKey('Group', null=True, default=None, blank=True, on_delete=CASCADE, related_name='variable_data')
|
group = models.ForeignKey('Group', null=True, default=None, blank=True, on_delete=CASCADE, related_name='variable_data')
|
||||||
@@ -199,6 +202,7 @@ class LaunchJobStatus(CommonModel):
|
|||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
app_label = 'main'
|
app_label = 'main'
|
||||||
|
verbose_name_plural = _('launch job statuses')
|
||||||
|
|
||||||
launch_job = models.ForeignKey('LaunchJob', null=True, on_delete=SET_NULL, related_name='launch_job_statuses')
|
launch_job = models.ForeignKey('LaunchJob', null=True, on_delete=SET_NULL, related_name='launch_job_statuses')
|
||||||
status = models.IntegerField()
|
status = models.IntegerField()
|
||||||
|
|||||||
Reference in New Issue
Block a user