5👍
✅
You can use source
argument like this:
class ChildSerializer(serializers.ModelSerializer):
name = serializers.CharField(source='store_product_mapping.master_product.name')
description = serializers.CharField(source='store_product_mapping.master_product.description')
class Meta:
model = X
fields = ('name', 'description', 'selling_price')
Source:stackexchange.com