title: DjangoRestFramework - correct way to add "required = false" to a ModelSerializer field?
body: <p>This is my serializer:</p>
  
  <pre><code>class PostSerializer(serializers.ModelSerializer):
  
      class Meta:
          model = Post
          fields = ('user', 'post', 'reblog',)
  
      def create(self, validated_data):
          post = Post(
                  user =  validated_data['user'],
                  post = validated_data['post'],
          )
  
          post.save() 
  
          # manually create a list of "reblog" users
          post.reblog.add(validated_data['user'])
  
          return post
  </code></pre>
  
  <p>and this is my model:</p>
  
  <pre><code>class Post(models.Model):
      user = models.ForeignKey(User)
      post = models.CharField(max_length=400)
      reblog = models.ManyToManyField(User)
  </code></pre>
  
  <p>Now, I don't want my reblog field to ever be null in the database (it can be an empty list, but not null). So I did not set "null=True" in the model field. However, the end user should not have to provide a list of "reblog" users when creating a post (I'll do that manually in the create() mtehod).</p>
  
  <p>I know that here: <a href="http://www.django-rest-framework.org/api-guide/fields/#core-arguments" rel="nofollow">http://www.django-rest-framework.org/api-guide/fields/#core-arguments</a> it says I can add "required = false" to a serializer field but the fields I am using in my serializer are directly coming from the model (i.e., fields = ('reblog')).</p>
  
  <p>From my understanding, I can't add "required = false" to my model because here:
  <a href="https://docs.djangoproject.com/en/1.8/ref/models/fields/" rel="nofollow">https://docs.djangoproject.com/en/1.8/ref/models/fields/</a> it does not mention "required" as a parameter to a model field.</p>
  
  <p>With that said, how can I get my "reblog" ModelSerializer field to not be required during serailzation / deserialization?</p>
  
  <p>Edit: the view which handles the post request sent is:</p>
  
  <pre><code>class post_list(APIView):
      """
      List all posts or create a new post.
      """
      permission_classes = (IsAuthenticated,)
  
      def get(self, request):
          posts = Post.objects.all()
          serializer = PostSerializer(posts, many=True)
          return Response(serializer.data)
  
      def post(self, request):
          serializer = PostSerializer(data=request.DATA)
          if serializer.is_valid():
              serializer.save()
              return Response(serializer.data, status=status.HTTP_201_CREATED)
          return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
  </code></pre>
  
  <p>pip freeze:</p>
  
  <pre><code>You are using pip version 6.1.1, however version 7.1.2 is available.
  You should consider upgrading via the 'pip install --upgrade pip' command.
  Django==1.8
  djangorestframework==3.1.1
  uWSGI==2.0.10
  </code></pre>