title: Django REST Framework serializer field required=false
body: <p>from the documentation:</p>
  
  <blockquote>
    <p>read_only
    Set this to True to ensure that the field is used when serializing a representation, but is not used when updating an instance during deserialization.</p>
    
    <p>Defaults to False</p>
    
    <p>required
    Normally an error will be raised if a field is not supplied during deserialization. Set to false if this field is not required to be present during deserialization.</p>
    
    <p>Defaults to True.</p>
  </blockquote>
  
  <p>So I have a model which has a field that's not nullable but I want it to be populated in the pre_save method, so I have set the field to <code>required=False</code> in serializer, but doesn't seem to work. I am still getting error when saving the record.</p>
  
  <pre><code>class FavoriteListSerializer(serializers.ModelSerializer):
      owner = serializers.IntegerField(required=False)
      class Meta:
          model = models.FavoriteList
  </code></pre>
  
  <p>Update:
  I have added <code>serializer_class = serializers.FavoriteListSerializer</code> to the ViewSet, now instead of getting <code>This field is required</code>, which I think got past the validation but then I am getting <code>This field cannot be null.</code> I have checked the pre_save method is not being executed, any ideas?</p>