title: DRF - Serializer Multiple Models
body: <p>How can I POST this JSON</p>
  <pre><code>{
    &quot;campaign&quot;: 27,
    &quot;campaignName&quot;: &quot;Prueba promo&quot;,
    &quot;promotionType&quot;: 999,
    &quot;items&quot;: [
       { &quot;item_nbr&quot;: 1234567890123, &quot;plu&quot;: 2},
       { &quot;item_nbr&quot;: 12345678901, &quot;plu&quot;: 3}
    ]
  }
  </code></pre>
  <p>Currently, I only get this response JSON</p>
  <pre><code>{
  &quot;items&quot;: [],
  &quot;campaign&quot;: 27,
  &quot;campaignName&quot;: &quot;Prueba promo&quot;,
  &quot;promotionType&quot;: 999,
  &quot;start_date&quot;: &quot;2019-03-04T12:02:16.574874-03:00&quot;,
  &quot;end_date&quot;: null,
  &quot;active&quot;: true
  }
  </code></pre>
  <p>How can I do it? I read the DRF documentation but it didn't work, what I'm doing wrong?
  here is my code</p>
  <p>my models.py</p>
  <pre><code>class Item(models.Model):
      promocion = models.ForeignKey(Promocion, related_name='items', on_delete=models.CASCADE, null=True)
      item_nbr = models.IntegerField(primary_key=True, help_text=&quot;Numero de Item&quot;)
      modular = models.ForeignKey(Modular, on_delete=models.CASCADE, null=True)
      price = models.FloatField()
      q_min = models.PositiveIntegerField(default=1, help_text=&quot;Cantidad mínima&quot;)
      q_mul = models.PositiveIntegerField(default=1, help_text=&quot;Multiplo de cajas cerradas&quot;)
      vensil1 = models.CharField(max_length=30, help_text=&quot;Atributo item relevante&quot;)
      vensil2 = models.CharField(max_length=30, help_text=&quot;Atributo item relevante&quot;)
      vensil3 = models.CharField(max_length=30, help_text=&quot;Atributo item relevante&quot;)
      FG = &quot;Fleje grande, 1/3 Carta&quot;
      FP = &quot;Fleje pequeño 1/6 Carta&quot;
      CP = &quot;Carteleria media Carta&quot;
      opciones = ((FG, &quot;Fleje grande, 1/3 Carta&quot;),
                  (FP, &quot;Fleje pequeño 1/6 Carta&quot;),
                  (CP, &quot;Carteleria media Carta&quot;),)
      print_type = models.CharField(choices=opciones, help_text=&quot;Fleje a imprimir&quot;, max_length=255)
      depto = models.IntegerField(default=1, help_text=&quot;Departamento&quot;)
      descri = models.CharField(max_length=100, help_text=&quot;Descripción producto&quot;)
      brand = models.ForeignKey(Brand, on_delete=models.CASCADE, null=True)
      vendor_pack = models.IntegerField(default=1)
      container = models.CharField(max_length=6, default=&quot;MAY&quot;)
      size = models.CharField(max_length=20, help_text=&quot;Tamaño pack&quot;)
      cont_net = models.FloatField(default=1, help_text=&quot;Contenido Neto&quot;)
      sell_unit = models.CharField(max_length=5, help_text=&quot;Unidad de venta&quot;)
      weight_drain = models.FloatField(default=0, help_text=&quot;Peso drenado&quot;)
      cod_bal = models.IntegerField(null=True, blank=True, help_text=&quot;Código balanza&quot;)
      plu = models.BigIntegerField(help_text=&quot;Código de barra&quot;)
  </code></pre>
  <p>here are my serializer.py</p>
  <pre><code>class ItemPromoSerializer(serializers.ModelSerializer):
      class Meta:
          model = Item
          fields = ('item_nbr', 'plu')
  
  class PromoSerializer(serializers.ModelSerializer):
      items = ItemPromoSerializer(many=True, read_only=True)
      #steps = ScalePromoSerializer(many=True)
      class Meta:
           model = Promocion
           fields = ('items', 'campaign', 'campaignName', 'promotionType', 
       'start_date', 'end_date', 'active')
  </code></pre>
  <p>my viewsets.py</p>
  <pre><code>class PromoViewSet(viewsets.ModelViewSet):
      queryset = Promocion.objects.all()
      serializer_class = PromoSerializer
  </code></pre>
  <p>and my routes.py</p>
  <pre><code>router.register(r'promo', PromoViewSet)
  </code></pre>
  <p>I've tried methods <code>to_internal_value()</code> and <code>to_representation()</code> but the result was</p>
  <pre><code>&quot;non_field_errors&quot;: [&quot;Invalid data. Expected a dictionary, but got list.&quot;]
  </code></pre>