46 lines
1.5 KiB
Python
Raw Normal View History

2013-12-15 17:09:22 +01:00
"""
register our models for Django's admin
"""
from django.contrib import admin
2014-11-02 00:53:06 +01:00
from .models import Host, RelatedHost, Domain, BlacklistedHost, ServiceUpdater, ServiceUpdaterHostConfig
2014-10-21 05:24:48 +02:00
@admin.register(Domain)
class DomainAdmin(admin.ModelAdmin):
list_display = ("name", "public", "available", "created_by")
list_filter = ("created", "public", "available")
search_fields = ("name", "created_by__username", "created_by__email")
2014-10-01 17:22:52 +02:00
2014-10-21 05:24:48 +02:00
@admin.register(Host)
class HostAdmin(admin.ModelAdmin):
list_display = ("name", "domain", "created_by", "client_faults", "abuse", "abuse_blocked")
list_filter = ("created", "abuse", "abuse_blocked", "domain")
search_fields = ("name", "created_by__username", "created_by__email")
2014-10-01 17:22:52 +02:00
2014-11-02 00:53:06 +01:00
@admin.register(RelatedHost)
class RelatedHostAdmin(admin.ModelAdmin):
list_display = ("name", "main_host", "available", "comment")
search_fields = ("name", "main_host__created_by__username", "main_host__created_by__email")
2014-10-21 05:24:48 +02:00
@admin.register(BlacklistedHost)
class BlacklistedHostAdmin(admin.ModelAdmin):
list_display = ("name_re", "created_by")
list_filter = ("created", )
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", )