from django.contrib import admin

from grandchallenge.components.models import (
    ComponentInterface,
    ComponentInterfaceValue,
)


class ComponentInterfaceAdmin(admin.ModelAdmin):
    list_display = (
        "pk",
        "title",
        "slug",
        "kind",
        "default_value",
        "relative_path",
    )
    readonly_fields = (
        "default_value",
        "relative_path",
    )


class ComponentInterfaceValueAdmin(admin.ModelAdmin):
    list_display = ("pk", "interface", "value", "file", "image")
    readonly_fields = ("interface", "value", "file", "image")


admin.site.register(ComponentInterface, ComponentInterfaceAdmin)
admin.site.register(ComponentInterfaceValue, ComponentInterfaceValueAdmin)

[(29, 'django.contrib.admin.site.register', 'admin.site.register', False, 'from django.contrib import admin\n'), (30, 'django.contrib.admin.site.register', 'admin.site.register', False, 'from django.contrib import admin\n')]