from apps.rem.models import Project
from apps.utils.serializers import CustomModelSerializer
from apps.system.serializers import FileSerializer
from rest_framework import serializers


class ProjectSerializer(CustomModelSerializer):
    leader_name = serializers.CharField(source="leader.name", read_only=True)
    files_ = FileSerializer(source="files", many=True, read_only=True)
    class Meta:
        model = Project
        fields = '__all__'

class ProjectUpdateSerializer(CustomModelSerializer):
    class Meta:
        model = Project
        fields = ["id", "participants", "files", "note"]