from rest_framework import serializers
from core.models.TeamMember import TeamMember

class TeamMemberSerializer(serializers.ModelSerializer):
    class Meta:
        model = TeamMember
        fields = ['user', 'team', 'isAdmin']
        read_only_fields = []

    def create(self, validated_data):
        """
        Creates a new team member using validated data.
        """
        return TeamMember.objects.create(**validated_data)
