import imp
from rest_framework import serializers
from ces_fall_rest_api.models.responses import Responses
from ces_fall_rest_api.serializers.section_serializer import SectionSerializer


class ResponseSerializer(serializers.ModelSerializer):
    """This class allow Responses model to convert to Python datatype 
    that can be rendered into JSON, XML, or other content types. 

    Args:
        serializers (_type_): serializers class
    """
    sections = SectionSerializer(read_only=True, source="section_set", many=True)
    class Meta:
        model = Responses
        fields = '__all__'
