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
|
|
|
|
|
|
|
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")
|
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")
|
2013-12-29 21:44:40 +01:00
|
|
|
|
|
|
|
|
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-09-21 22:47:05 +02:00
|
|
|
admin.site.register(BlacklistedHost, BlacklistedHostAdmin)
|
2013-12-29 21:44:40 +01:00
|
|
|
admin.site.register(Domain, DomainAdmin)
|
|
|
|
admin.site.register(Host, HostAdmin)
|
2013-11-26 08:10:05 +01:00
|
|
|
admin.site.register(ServiceUpdater)
|
|
|
|
admin.site.register(ServiceUpdaterHostConfig)
|