title: Django views.py change json before creating a model
body: <p>I have a Django app and a model Unit in it.</p>
  <pre><code>TYPES = (
      ('offer', 'OFFER'),
      ('Category', 'CATEGORY'),
  )
  
  class Unit(models.Model):
      id = models.CharField('ID', max_length=50, primary_key=True)
      unit_type = models.CharField(max_length=30, choices=TYPES)
      name = models.CharField('Name', max_length=50)
      date = models.DateTimeField('Date of creation or last update', null=True)
  
      parents_id = models.ForeignKey('self', related_name='children', blank=True, null=True, on_delete=models.CASCADE)
      price = models.PositiveIntegerField('Price', default=0, blank=True, null=False)
  </code></pre>
  <p>But json passed to me always has an array of units called 'items' and a date</p>
  <pre><code>&quot;items&quot;: [
          {
              &quot;type&quot;: &quot;CATEGORY&quot;,
              &quot;name&quot;: &quot;phones&quot;,
              &quot;id&quot;: &quot;d515e43f-f3f6-4471-bb77-6b455017a2d2&quot;,
              &quot;parentId&quot;: &quot;069cb8d7-bbdd-47d3-ad8f-82ef4c269df1&quot;
          },
          {
              &quot;type&quot;: &quot;OFFER&quot;,
              &quot;name&quot;: &quot;jPhone 13&quot;,
              &quot;id&quot;: &quot;863e1a7a-1304-42ae-943b-179184c077e3&quot;,
              &quot;parentId&quot;: &quot;d515e43f-f3f6-4471-bb77-6b455017a2d2&quot;,
              &quot;price&quot;: 79999
          },
          {
              &quot;type&quot;: &quot;OFFER&quot;,
              &quot;name&quot;: &quot;Xomiа Readme 10&quot;,
              &quot;id&quot;: &quot;b1d8fd7d-2ae3-47d5-b2f9-0f094af800d4&quot;,
              &quot;parentId&quot;: &quot;d515e43f-f3f6-4471-bb77-6b455017a2d2&quot;,
              &quot;price&quot;: 59999
          }
      ],
      &quot;updateDate&quot;: &quot;2022-02-02T12:00:00.000Z&quot;
  </code></pre>
  <p>what I want to do is create a unit out of every element in items and pass updateDate as date to each unit. How can I do this with views and serializer?</p>
  <pre><code>class UnitViewSet(viewsets.ModelViewSet):
      serializer_class = UnitSerializer
      queryset = Unit.objects.all()
  
  from rest_framework import serializers
  from .models import Unit
  from rest_framework_recursive.fields import RecursiveField
  
  class UnitSerializer(serializers.ModelSerializer):
      children = serializers.ListField(child=RecursiveField())
  
      class Meta:
          model = Unit
          fields = &quot;__all__&quot;
  </code></pre>