network_inventory/backups/admin.py
Andreas Zweili e79eba2828 show all models in the admin interface
Since we decided to create many forms in the frontend the admin interface
should really be a way to access all models even the ones which aren't
accessible from the front end.
2020-06-08 17:02:15 +02:00

34 lines
740 B
Python

from django.contrib import admin
from .models import (
Backup,
BackupMethod,
Notification,
NotificationType,
NotificationFromBackup,
TargetDevice,
)
class TargetDeviceInLine(admin.StackedInline):
model = TargetDevice
extra = 0
verbose_name_plural = 'Target Devices'
class NotificationForBackupInLine(admin.StackedInline):
model = NotificationFromBackup
extra = 0
verbose_name_plural = 'Notifications'
class BackupAdmin(admin.ModelAdmin):
inlines = (TargetDeviceInLine, NotificationForBackupInLine)
admin.site.register(Backup, BackupAdmin)
admin.site.register(BackupMethod)
admin.site.register(Notification)
admin.site.register(NotificationType)
admin.site.register(TargetDevice)