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, 0, 29, 64), 'django.contrib.admin.site.register', 'admin.site.register', ({(29, 20, 29, 38): 'ComponentInterface', (29, 40, 29, 63): 'ComponentInterfaceAdmin'}, {}), '(ComponentInterface, ComponentInterfaceAdmin)', False, 'from django.contrib import admin\n'), ((30, 0, 30, 74), 'django.contrib.admin.site.register', 'admin.site.register', ({(30, 20, 30, 43): 'ComponentInterfaceValue', (30, 45, 30, 73): 'ComponentInterfaceValueAdmin'}, {}), '(ComponentInterfaceValue, ComponentInterfaceValueAdmin)', False, 'from django.contrib import admin\n')]