title: Django Rest Framework: make a serializer field not required in post data when perform create re
body: <p>I have the following setup:</p>
  
  <p><strong>Models.py</strong></p>
  
  <pre><code>class QuoteModel(models.Model):
      """
          this model stores initial information for the Quote
      """
      quote_number = models.CharField(max_length=20,
                                      unique=True,
                                      help_text="Please use the quote number from pms",)
      description = models.CharField(max_length=200,
                                     help_text="Enter description that you might find helpful")
      creator = models.ForeignKey(User)
      date_created = models.DateField(auto_now_add=True)
  </code></pre>
  
  <p><strong>Serializer.py</strong></p>
  
  <pre><code># Serializers define the API representation.
  class QuoteModelSerializer(serializers.ModelSerializer):
      class Meta:
          model = Quote
          fields = ('id', 'quote_number', 'description', 'creator', 'date_created')
          read_only_fields = ('date_created',)
  </code></pre>
  
  <p><strong>View.py</strong></p>
  
  <pre><code>class QuoteListCreateView(generics.ListCreateAPIView):
      queryset = Quote.objects.all()
      serializer_class = QuoteModelSerializer
      permission_classes = (permissions.IsAuthenticated, )
  
      def perform_create(self, serializer):
          serializer.save(creator=self.request.user)
  </code></pre>
  
  <p>In the snippet, I am setting up the <code>creator</code> field of <code>QuoteModel</code> in the view's <code>perform_create</code> method. Since <code>QuoteListCreateView</code> is an authenticated only view, therefore, I don't want to pass the <code>creator</code> during the quote create request (post to <code>/quotes</code>). <code>creator</code> is a part of the serializer class, the post request returns the following if I don't pass the creator.
  "creator": [
      "This field is required."
    ]"</p>
  
  <p>Therefore, my question is-
     Is there anyway to make the <code>creator</code> parameter optional on post request? I can not add <code>null=true</code> on <code>creator</code> field in model.py  because it is required from models perspective.</p>
  
  <p>Thanks in advance.</p>
  
  <p><strong>Fix</strong></p>
  
  <p>overriding the <code>creator</code> attribute in the model serializer and set required to False resolved the issue.</p>
  
  <pre><code>class QuoteModelSerializer(serializers.ModelSerializer):
      creator = serializers.PrimaryKeyRelatedField(required=False, queryset=User.objects.all())
      class Meta:
          model = Quote
          fields = ('id', 'quote_number', 'description', 'creator', 'date_created')
          read_only_fields = ('date_created',)
  </code></pre>