You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
666 B
Python
22 lines
666 B
Python
from django.contrib import admin
|
|
from .models import Nomenclature, NomenclatureField, NomenclatureEntry
|
|
|
|
|
|
class NomenclatureFieldInline(admin.TabularInline):
|
|
model = NomenclatureField
|
|
extra = 1
|
|
|
|
|
|
@admin.register(Nomenclature)
|
|
class NomenclatureAdmin(admin.ModelAdmin):
|
|
list_display = ['code', 'name', 'applies_to', 'kind', 'sort_order']
|
|
list_filter = ['applies_to', 'kind']
|
|
search_fields = ['code', 'name']
|
|
inlines = [NomenclatureFieldInline]
|
|
|
|
|
|
@admin.register(NomenclatureEntry)
|
|
class NomenclatureEntryAdmin(admin.ModelAdmin):
|
|
list_display = ['id', '__str__', 'nomenclature', 'is_active']
|
|
list_filter = ['nomenclature', 'is_active']
|