from django.contrib import admin from django_mptt_admin.admin import DjangoMpttAdmin from .models import Box, BoxType, Thing, ThingType @admin.register(BoxType) class BoxTypeAdmin(admin.ModelAdmin): """Admin configuration for BoxType model.""" list_display = ('name', 'width', 'height', 'length') search_fields = ('name',) @admin.register(Box) class BoxAdmin(admin.ModelAdmin): """Admin configuration for Box model.""" list_display = ('id', 'box_type') list_filter = ('box_type',) search_fields = ('id',) @admin.register(ThingType) class ThingTypeAdmin(DjangoMpttAdmin): """Admin configuration for ThingType model.""" search_fields = ('name',) @admin.register(Thing) class ThingAdmin(admin.ModelAdmin): """Admin configuration for Thing model.""" list_display = ('name', 'thing_type', 'box') list_filter = ('thing_type', 'box') search_fields = ('name', 'description')