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
32 lines
1.2 KiB
Python
32 lines
1.2 KiB
Python
from django.contrib import admin
|
|
from .models import LeistungstestTemplate, LeistungstestTemplateExercise, LeistungstestResult, LeistungstestResultItem
|
|
|
|
|
|
class LeistungstestTemplateExerciseInline(admin.TabularInline):
|
|
model = LeistungstestTemplateExercise
|
|
extra = 0
|
|
readonly_fields = ['exercise']
|
|
|
|
|
|
@admin.register(LeistungstestTemplate)
|
|
class LeistungstestTemplateAdmin(admin.ModelAdmin):
|
|
list_display = ['name', 'created_at', 'usage_count']
|
|
search_fields = ['name']
|
|
inlines = [LeistungstestTemplateExerciseInline]
|
|
|
|
|
|
@admin.register(LeistungstestResult)
|
|
class LeistungstestResultAdmin(admin.ModelAdmin):
|
|
list_display = ['id', 'wrestler', 'template', 'total_time_seconds', 'score_percent', 'rating', 'completed_at']
|
|
list_filter = ['template', 'rating', 'completed_at']
|
|
search_fields = ['wrestler__first_name', 'wrestler__last_name', 'template__name']
|
|
readonly_fields = ['score_percent', 'created_at']
|
|
raw_id_fields = ['wrestler', 'template']
|
|
|
|
|
|
@admin.register(LeistungstestResultItem)
|
|
class LeistungstestResultItemAdmin(admin.ModelAdmin):
|
|
list_display = ['id', 'result', 'exercise', 'target_reps', 'actual_reps', 'elapsed_seconds', 'order']
|
|
list_filter = ['exercise']
|
|
raw_id_fields = ['result', 'exercise']
|