class SubCommentDetailInfoSerializer(serializers.ModelSerializer): detail = CommentDetailSerializer() author = GuestSerializer() reply_to_author = GuestSerializer() class Meta: list_serializer_class = OrderSubCommentListSerializer model = MaterialCommentInfo fields = "__all__"
class CommentDetailInfoSerializer(serializers.ModelSerializer): detail = CommentDetailSerializer() author = GuestSerializer() reply_to_author = GuestSerializer() sub_comment = SubCommentDetailInfoSerializer(many=True) class Meta: model = MaterialCommentInfo fields = "__all__"