[Django]-Get nested serialized data as one

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')

Leave a comment