from django.contrib import admin
from .models import Topic, TopicCallback, Message


class TopicAdmin(admin.ModelAdmin):
    list_display = ['id', 'topic', 'arn']
    list_display_links = ['topic']


class TopicCallbackAdmin(admin.ModelAdmin):
    list_display = ['id', 'topic', 'callback', 'arn']
    list_display_links = ['topic', ]


class MessageAdmin(admin.ModelAdmin):
    list_display = ['topic', 'message_id', 'source', 'content_type']
    readonly_fields = ['message_id', 'content_type', 'object_id', 'topic', 'subject', 'message', 'source']
    list_filter = ('created', 'content_type')


admin.site.register(Topic, TopicAdmin)
admin.site.register(TopicCallback, TopicCallbackAdmin)
admin.site.register(Message, MessageAdmin)
