[Answered ]-Django Rest Framework – Nested Serialization with intermediary model

2👍

Try to specify source of field using source keyword in LinkSerializer:

class LinkSerializer(serializers.ModelSerializer):
    given_name = serializers.CharField(source='child.given_name')
    id = given_name = serializers.CharField(source='child.id')  

    class Meta:
        model = Link
        fields = ('given_name', 'id')

Leave a comment