title: How do I do a post request with related serializers Django rest framework
body: <p>I have model <code>Package</code> with <code>Supplier</code> and <code>PackageSize</code>,  foreign keys and a field to which is also a foreign key of a <code>Shipping model</code> which contains where the supplier wants to ship the package so to make sure I a user can submit the whole information in one request, I created my serializers and linked them like such.</p>
  <p><code>serializers.py</code></p>
  <pre><code>from users.models import Supplier
  from packages.models import Package , PackageSize , ShippingLocation , Shipping
  
      class ShippingLocationSerializer(serializers.ModelSerializer):
          class Meta:
              model= ShippingLocation
              fields = ['latitude','longitude']
          def create(self, validated_data):
              return ShippingLocation(**validated_data)
  
      class PackageSizeSerializer(serializers.ModelSerializer):
          class Meta:
              model= PackageSize
              fields = ['length', 'width' ,'height' ,'weight']
          def create(self, validated_data):
              &quot;&quot;&quot;
              docstring
              &quot;&quot;&quot;
              pass
  
      class ShippingSerializer(serializers.ModelSerializer):
          location = ShippingLocationSerializer(source='location_set')
          class Meta:
              model = Shipping
              fields = [
                  'first_name', 
                  'last_name',
                  'phone_number',
                  'email',
                  'street_address',
                  'village',
                  'district',
                  'country',
                  'location'
                  ]
          def create(self, validated_data):
              &quot;&quot;&quot;
              docstring
              &quot;&quot;&quot;
              pass
  
      class SupplierPackageSerializer(serializers.ModelSerializer):
          size = PackageSizeSerializer(source='size_set')
          shipping_location= ShippingSerializer(source='to_set')
          class Meta:
              model = Package
              fields = ['supplier', 'name', 'size', 'shipping_location', ]
              read_only_fields = ['supplier']
          
          def create(self, validated_data):
              user =Supplier.objects.get(username=self.context['request'].user)
              return Package(supplier=user, **validated_data )
  </code></pre>
  <p>and created my views like such</p>
  <p><code>view.py</code></p>
  <pre><code>from rest_framework import generics
  from packages.models import Package
  from .serializers import , SupplierPackageSerializer
  from rest_framework.permissions import IsAuthenticated
  
  class SupplierPackageViewSet(generics.ListCreateAPIView):
      serializer_class = SupplierPackageSerializer
      queryset = Package.objects.all().order_by('-name')
      permission_classes = [IsAuthenticated]
      
  </code></pre>
  <p><code>models.py</code></p>
  <pre><code>from django.db import models    
  from django.conf import settings
  from users.models import Supplier
  
  class ShippingLocation(models.Model):
      latitude = models.IntegerField()
      longitude = models.IntegerField()
  
  class Shipping (models.Model):
      first_name = models.CharField(max_length=30)
      last_name = models.CharField(max_length=30)
      phone_number =  models.CharField(max_length=14)
      email = models.EmailField()
      street_address = models.CharField(max_length=30)
      village = models.CharField(max_length=30)
      district = models.CharField(max_length=30)
      country = models.CharField(max_length=30)
      location = models.OneToOneField(ShippingLocation , default=None, on_delete=models.CASCADE )
  
      # Returns the string representation of the model.
      def __str__(self):
          return self.email
  
  class PackageSize(models.Model):
      length = models.IntegerField()
      width = models.IntegerField()
      height = models.IntegerField()
      weight = models.IntegerField()
  
  # Create your models here.
  class Package(models.Model):
      TYPE = (
          ('1', 'Envelope'),
          ('2', 'Parcel'),
          ('2', 'Soft'),
          ('2', 'Freezed'),
      )
      TYPE = (
          ('1', 'CREATED IN SYSTEM'),
          ('2', ''),
          ('2', 'Soft'),
          ('2', 'Freezed'),
      )
      name = models.CharField(max_length=30)
      supplier = models.ForeignKey( Supplier , on_delete=models.DO_NOTHING)
      to =  models.ForeignKey(Shipping, default=None, on_delete=models.CASCADE )
      size = models.ForeignKey( PackageSize, default=None, on_delete=models.CASCADE )
      type = models.CharField(max_length=1, default=&quot;1&quot;, choices=TYPE)
      
      def __str__(self):
          return self.name
  </code></pre>
  <p>the challenge is when I submit the data it is validated very well but it cannot be saved and I get this error</p>
  <pre><code>TypeError at /supplier/package
  Package() got an unexpected keyword argument 'size_set'
  </code></pre>