from drf_writable_nested.serializers import WritableNestedModelSerializer
from ces_fall_rest_api.models.faculty import Faculty

from .user_serializer import UserSerializer


class FacultySerializer(WritableNestedModelSerializer):
    """This class allow Faculty model to convert to Python datatype 
    that can be rendered into JSON, XML, or other content types. 

    Args:
        WritableNestedModelSerializer (_type_): WritableNestedModelSerializer class
        This clss allows you to create/update your models with related nested data
    """
    user = UserSerializer()
    class Meta:
        model = Faculty
        fields = '__all__'