3fefc550fe
- Django backend with DRF (clubs, wrestlers, trainers, exercises, templates, trainings, homework, locations, leistungstest) - Next.js 16 frontend with React, Shadcn UI, Tailwind - JWT authentication - Full CRUD for all entities - Calendar view for trainings - Homework management system - Leistungstest tracking
33 lines
1.1 KiB
Python
33 lines
1.1 KiB
Python
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',)
|
|
}),
|
|
)
|