import unfold from unfold.admin import ModelAdmin as UnfoldModelAdmin from django.contrib import admin from .models import Wrestler @admin.register(Wrestler) class WrestlerAdmin(UnfoldModelAdmin): list_display = ['first_name', 'last_name', 'club', 'group', 'weight_category', 'is_active'] list_filter = ['group', 'is_active', 'club', 'gender'] search_fields = ['first_name', 'last_name', 'license_number'] readonly_fields = ['created_at', 'updated_at', 'calculate_age'] raw_id_fields = ['club'] fieldsets = ( ('Personal Info', { 'fields': ('first_name', 'last_name', 'club', 'group', 'gender', 'date_of_birth') }), ('Wrestling Info', { 'fields': ('weight_category', 'weight_kg') }), ('License & Documents', { 'fields': ('license_number', 'license_expiry', 'photo', 'license_scan') }), ('Status', { 'fields': ('is_active', 'notes') }), ('Metadata', { 'fields': ('created_at', 'updated_at'), 'classes': ('collapse',) }), )