title: How to deal with nested serializer fields in Django Rest Framework?
body: <p>I have nested serializer (AmountSerializer). I need a field meal_name in one ViewSet. But when this field is nested, I don't need it to be seen in endpoint(in MealSerializer). How to exclude field from nested serializer when is it actually nested?
  models.py:</p>
  <pre><code>class MealType(models.Model):
      name = models.TextField()
  
      def __str__(self):
          return self.name
  
  class Ingredient(models.Model):
      name = models.TextField()
      
      def __str__(self):
          return self.name
  
  class Meal(models.Model):
      name = models.TextField()
      type = models.ForeignKey(MealType, on_delete=models.CASCADE, default=None)
      recipe = models.TextField()
      photo = models.ImageField(null=True, height_field=None, width_field=None, max_length=None,upload_to='media/')
      ingredients = models.ManyToManyField(Ingredient)
  
      def __str__(self):
          return self.name    
  
  class IngredientAmount(models.Model):
      ingredient_name = models.ForeignKey(Ingredient, on_delete=models.CASCADE, default=None)
      amount = models.FloatField(default=None)
      meal = models.ForeignKey(Meal, on_delete=models.CASCADE, default=None, related_name='meal_id')
  
      class Meta:
          ordering = ['meal']
  
      def __str__(self):
          return self.ingredient_name
  </code></pre>
  <p>serializers.py:</p>
  <pre><code>class AmountSerializer(serializers.ModelSerializer):
      ingredient_name= serializers.ReadOnlyField(source='ingredient_name.name')
      --&gt;#meal_name = serializers.ReadOnlyField(source='meal.name')
         #I CAN'T use ReadOnlyField( #with write_only=True)
         #i trired use PrimaryKeyRelatedField
         # butgot  AssertionError: Relational field must provide a `queryset` argument, override `get_queryset`, or set read_only=`True`.
      class Meta:
          model = IngredientAmount    
          fields = ('ingredient_name','amount','meal_name')
  
  class MealSerializer(serializers.ModelSerializer):
      type_name= serializers.ReadOnlyField(source='type.name')
      ingredients = serializers.SlugRelatedField(read_only=True, slug_field='name', many=True)   
      amount = AmountSerializer(read_only=True,  many=True,source='meal_id')
      
      class Meta:
          model = Meal
          fields = ('id', 'name', 'type_name', 'recipe', 'photo', 'ingredients','amount')
  </code></pre>