minor admin interface improvments

This commit is contained in:
elnappo 2014-12-28 15:53:22 +01:00
parent 419704618d
commit 8994be6ca1

View File

@ -10,6 +10,7 @@ from .models import Host, RelatedHost, Domain, BlacklistedHost, ServiceUpdater,
@admin.register(Domain) @admin.register(Domain)
class DomainAdmin(admin.ModelAdmin): class DomainAdmin(admin.ModelAdmin):
list_display = ("name", "public", "available", "created_by") list_display = ("name", "public", "available", "created_by")
list_display_links = ("created_by", )
list_filter = ("created", "public", "available") list_filter = ("created", "public", "available")
search_fields = ("name", "created_by__username", "created_by__email") search_fields = ("name", "created_by__username", "created_by__email")
@ -17,6 +18,7 @@ class DomainAdmin(admin.ModelAdmin):
@admin.register(Host) @admin.register(Host)
class HostAdmin(admin.ModelAdmin): class HostAdmin(admin.ModelAdmin):
list_display = ("name", "domain", "created_by", "client_faults", "abuse", "abuse_blocked") list_display = ("name", "domain", "created_by", "client_faults", "abuse", "abuse_blocked")
list_display_links = ("domain", "created_by")
list_filter = ("created", "abuse", "abuse_blocked", "domain") list_filter = ("created", "abuse", "abuse_blocked", "domain")
search_fields = ("name", "created_by__username", "created_by__email") search_fields = ("name", "created_by__username", "created_by__email")
@ -24,22 +26,26 @@ class HostAdmin(admin.ModelAdmin):
@admin.register(RelatedHost) @admin.register(RelatedHost)
class RelatedHostAdmin(admin.ModelAdmin): class RelatedHostAdmin(admin.ModelAdmin):
list_display = ("name", "main_host", "available", "comment") list_display = ("name", "main_host", "available", "comment")
list_display_links = ("main_host", )
search_fields = ("name", "main_host__created_by__username", "main_host__created_by__email") search_fields = ("name", "main_host__created_by__username", "main_host__created_by__email")
@admin.register(BlacklistedHost) @admin.register(BlacklistedHost)
class BlacklistedHostAdmin(admin.ModelAdmin): class BlacklistedHostAdmin(admin.ModelAdmin):
list_display = ("name_re", "created_by") list_display = ("name_re", "created_by")
list_display_links = ("created_by", )
list_filter = ("created", ) list_filter = ("created", )
@admin.register(ServiceUpdater) @admin.register(ServiceUpdater)
class ServiceUpdaterAdmin(admin.ModelAdmin): class ServiceUpdaterAdmin(admin.ModelAdmin):
list_display = ("name", "comment", "created_by") list_display = ("name", "comment", "created_by")
list_display_links = ("created_by", )
list_filter = ("created", ) list_filter = ("created", )
@admin.register(ServiceUpdaterHostConfig) @admin.register(ServiceUpdaterHostConfig)
class ServiceUpdaterHostConfigAdmin(admin.ModelAdmin): class ServiceUpdaterHostConfigAdmin(admin.ModelAdmin):
list_display = ("host", "service", "hostname", "comment", "created_by") list_display = ("host", "service", "hostname", "comment", "created_by")
list_display_links = ("created_by", )
list_filter = ("created", ) list_filter = ("created", )