title: Creating a new record with POST gives error: Got a TypeError when calling Product.objects.create()
body: <p>I'm using Django REST Framework and have the folowing view class to view or create product. Now I'm trying to add a new record with POST method, but I get the error below. Can anyone tell me why and how can I fix this? </p>
  
  <p>updated .   ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ </p>
  
  <pre><code>TypeError at /store/view/
  Got a `TypeError` when calling `Product.objects.create()`. This may be because you have a writable field on the serializer class that is not a valid argument to `Product.objects.create()`. You may need to make the field read-only, or override the ProductSerializer.create() method to handle this correctly.
  </code></pre>
  
  <p>view class: </p>
  
  <pre><code>class StoreApiView(mixins.CreateModelMixin, generics.ListAPIView):
      lookup_field = 'pk'
      serializer_class = ProductSerializer
      permission_classes = [IsAuthenticatedOrReadOnly]
  
      def get_queryset(self):
          qs = Product.objects.all()
          query = self.request.GET.get('q')
          if query is not None:
              qs = qs.filter(
                  Q(title__icontains=query) |
                  Q(description__icontains=query)
              ).distinct()
          return qs
  
      def perform_create(self, serializer):
          serializer.save(author=self.request.user, context={'request': self.request})
  
      def post(self, request, *args, **kwargs):
          return self.create(request, *args, **kwargs)
  </code></pre>
  
  <p>and the related serializer class: </p>
  
  <pre><code>class ProductSerializer(ModelSerializer):
      product_ratings = ProductRatingSerializer(many=True, read_only=True)
      product_badges_set = ProductBadgesSerializer(many=True, read_only=True)
  
      author = serializers.SerializerMethodField()
  
      def get_author(self, obj):
          return obj.author.first_name + ' ' + obj.author.last_name
  
      def get_category(self, obj):
          return obj.category.title
  
      class Meta:
          model = Product
          fields = [
              'product_id',
              'author',
              'title',
              'mini_description',
              'you_learn',
              'you_need',
              'full_description',
              'price',
              'video_level',
              'video_length',
              'created_date',
              'updated_date',
              'product_ratings',
              'product_badges_set',
          ]
          read_only_fields = ['product_id', 'created_date', 'updated_date', 'author','product_badges_set',
                              'product_ratings']
  </code></pre>
  
  <p>model:</p>
  
  <pre><code>class Product(models.Model):
      product_id = models.AutoField(primary_key=True)
      author = models.ForeignKey(User, on_delete=models.CASCADE, db_index=True)
      title = models.CharField(max_length=120)
      video_length = models.CharField(max_length=20, null=True, blank=True)
      mini_description = models.CharField(max_length=220, null=True, blank=True)
      full_description = models.TextField(null=True, blank=True)
      you_need = models.CharField(max_length=120, null=True)
      you_learn = models.CharField(max_length=250, null=True)
      price = models.CharField(max_length=50, null=True, blank=True)
      video_level = models.CharField(max_length=100, null=True, blank=True)
      created_date = models.DateTimeField(auto_now_add=True)
      updated_date = models.DateTimeField(auto_now=True)
  
      def __str__(self):
          return self.title
  
      @property
      def owner(self):
          return self.author
  </code></pre>