konova/codelist/admin.py
mpeltriaux b0f3505972 #99 Admin backend cleanup
* removes admin backend views which are not important for production
* adds filtering functionalities on index views
* simplifies detail views on intervention, compensation, ecoaccount and ema
* adds autocomplete fields on detail views
* adds handy horizontal filter fields on detail views
2022-02-01 18:41:02 +01:00

48 lines
856 B
Python

from django.contrib import admin
from codelist.models import KonovaCode, KonovaCodeList
class KonovaCodeListAdmin(admin.ModelAdmin):
list_display = [
"id",
]
readonly_fields = [
"id",
"codes",
]
class KonovaCodeAdmin(admin.ModelAdmin):
list_display = [
"id",
"atom_id",
"parent",
"short_name",
"long_name",
"is_leaf",
"is_selectable",
"is_archived",
]
readonly_fields = [
"id",
"short_name",
"long_name",
"is_archived",
"is_selectable",
"is_leaf",
"parent",
]
search_fields = [
"id",
"atom_id",
"long_name",
"short_name",
]
#admin.site.register(KonovaCodeList, KonovaCodeListAdmin)
admin.site.register(KonovaCode, KonovaCodeAdmin)