2013-12-15 17:09:22 +01:00
|
|
|
"""
|
|
|
|
register our models for Django's admin
|
|
|
|
"""
|
|
|
|
|
2013-09-28 20:01:09 +02:00
|
|
|
from django.contrib import admin
|
|
|
|
|
2014-09-21 22:47:05 +02:00
|
|
|
from .models import Host, Domain, BlacklistedHost, ServiceUpdater, ServiceUpdaterHostConfig
|
2013-10-03 19:26:39 +02:00
|
|
|
|
2013-12-29 21:44:40 +01:00
|
|
|
|
2014-10-21 05:24:48 +02:00
|
|
|
@admin.register(Domain)
|
2013-12-29 21:44:40 +01:00
|
|
|
class DomainAdmin(admin.ModelAdmin):
|
2014-09-21 22:31:26 +02:00
|
|
|
list_display = ("name", "public", "available", "created_by")
|
2014-09-03 18:23:50 +02:00
|
|
|
list_filter = ("created", "public", "available")
|
2014-10-01 17:12:14 +02:00
|
|
|
search_fields = ("name", "created_by__username", "created_by__email")
|
2013-12-29 21:44:40 +01:00
|
|
|
|
2014-10-01 17:22:52 +02:00
|
|
|
|
2014-10-21 05:24:48 +02:00
|
|
|
@admin.register(Host)
|
2013-12-29 21:44:40 +01:00
|
|
|
class HostAdmin(admin.ModelAdmin):
|
2014-09-21 22:31:26 +02:00
|
|
|
list_display = ("name", "domain", "created_by", "client_faults", "abuse", "abuse_blocked")
|
2014-09-03 18:23:50 +02:00
|
|
|
list_filter = ("created", "abuse", "abuse_blocked", "domain")
|
2014-10-01 17:12:14 +02:00
|
|
|
search_fields = ("name", "created_by__username", "created_by__email")
|
2013-12-29 21:44:40 +01:00
|
|
|
|
2014-10-01 17:22:52 +02:00
|
|
|
|
2014-10-21 05:24:48 +02:00
|
|
|
@admin.register(BlacklistedHost)
|
2014-09-21 22:47:05 +02:00
|
|
|
class BlacklistedHostAdmin(admin.ModelAdmin):
|
2014-09-21 22:31:26 +02:00
|
|
|
list_display = ("name_re", "created_by")
|
2014-09-03 18:23:50 +02:00
|
|
|
list_filter = ("created", )
|
2013-12-29 21:44:40 +01:00
|
|
|
|
|
|
|
|
2014-10-21 05:24:48 +02:00
|
|
|
@admin.register(ServiceUpdater)
|
|
|
|
class ServiceUpdaterAdmin(admin.ModelAdmin):
|
|
|
|
list_display = ("name", "comment", "created_by")
|
|
|
|
list_filter = ("created", )
|
|
|
|
|
|
|
|
|
|
|
|
@admin.register(ServiceUpdaterHostConfig)
|
|
|
|
class ServiceUpdaterHostConfigAdmin(admin.ModelAdmin):
|
|
|
|
list_display = ("host", "service", "hostname", "comment", "created_by")
|
|
|
|
list_filter = ("created", )
|