From 924b9ad3adbb2ea8e82362f6d9951edddef53687 Mon Sep 17 00:00:00 2001 From: Fabian Weisshaar Date: Sun, 29 Dec 2013 21:44:40 +0100 Subject: [PATCH] add ModelAdmin for DomainAdmin, HostAdmin and BlacklistedDomainAdmin --- nsupdate/main/admin.py | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/nsupdate/main/admin.py b/nsupdate/main/admin.py index ef3c134..5ad9f41 100644 --- a/nsupdate/main/admin.py +++ b/nsupdate/main/admin.py @@ -6,8 +6,24 @@ from django.contrib import admin from .models import Host, Domain, BlacklistedDomain, ServiceUpdater, ServiceUpdaterHostConfig -admin.site.register(BlacklistedDomain) -admin.site.register(Domain) -admin.site.register(Host) + +class DomainAdmin(admin.ModelAdmin): + list_display = ("domain", "public", "available", "created_by") + list_filter = ("public", "available", "created_by") + + +class HostAdmin(admin.ModelAdmin): + list_display = ("subdomain", "domain", "abuse_blocked") + list_filter = ("domain", "created_by", "abuse", "abuse_blocked") + + +class BlacklistedDomainAdmin(admin.ModelAdmin): + list_display = ("domain", "created_by") + list_filter = ("created_by", "created") + + +admin.site.register(BlacklistedDomain, BlacklistedDomainAdmin) +admin.site.register(Domain, DomainAdmin) +admin.site.register(Host, HostAdmin) admin.site.register(ServiceUpdater) admin.site.register(ServiceUpdaterHostConfig)