title: Django Rest Framework "A valid integer is required."?
body: <p>I want to default an empty string to a 0 or null during deserialization. </p>
  
  <p>JSON</p>
  
  <pre><code>{
    'injuries': '6',
    'children': '2',
    'civilians': '',
  }
  </code></pre>
  
  <p>However, I keep getting this error: </p>
  
  <blockquote>
    <p>"A valid integer is required."</p>
  </blockquote>
  
  <p>models.py</p>
  
  <pre><code>from django.db import models    
  
  class Strike(models.Model):
      location = models.ForeignKey('Location', on_delete=models.CASCADE)
      civilians = models.PositiveIntegerField(blank=True, null=True)
      injuries = models.PositiveIntegerField(blank=True, null=True)
      children = models.PositiveIntegerField(blank=True, null=True)
  </code></pre>
  
  <p>serializers.py</p>
  
  <pre><code>from rest_framework import serializers
  from .models import Strike
  
  
  class StrikeSerializer(serializers.ModelSerializer):
      civilians = serializers.IntegerField(default=0, required=False)
  
      class Meta:
          model = Strike
          fields = '__all__'
  
      def create(self, validated_data):
          return Strike.objects.create(**validated_data)
  </code></pre>
  
  <p>main</p>
  
  <pre><code>serializer = StrikeSerializer(data=strike)
  </code></pre>
  
  <p>I tried manipulating data in create method, but the error gets raised before that. Where in the DRF structure can I override this, specifically convert '' to 0 or None?</p>