Initial commit: WrestleDesk full project
- 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
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
from rest_framework import serializers
|
||||
from .models import Wrestler
|
||||
|
||||
|
||||
class WrestlerSerializer(serializers.ModelSerializer):
|
||||
club_name = serializers.CharField(source='club.name', read_only=True)
|
||||
age = serializers.SerializerMethodField()
|
||||
|
||||
class Meta:
|
||||
model = Wrestler
|
||||
fields = '__all__'
|
||||
read_only_fields = ['created_at', 'updated_at', 'age']
|
||||
|
||||
def get_age(self, obj):
|
||||
return obj.calculate_age()
|
||||
Reference in New Issue
Block a user