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,14 @@
|
||||
from rest_framework import serializers
|
||||
from .models import Club
|
||||
|
||||
|
||||
class ClubSerializer(serializers.ModelSerializer):
|
||||
wrestler_count = serializers.SerializerMethodField()
|
||||
|
||||
class Meta:
|
||||
model = Club
|
||||
fields = '__all__'
|
||||
read_only_fields = ['created_at', 'updated_at']
|
||||
|
||||
def get_wrestler_count(self, obj):
|
||||
return obj.wrestlers.filter(is_active=True).count()
|
||||
Reference in New Issue
Block a user