IntegrityError : (1048, "Column 'user_dob' cannot be null")
<p>I have modified my serializers fields by as follow,</p>

<pre><code>class UserSerializer(serializers.ModelSerializer):
    id = serializers.IntegerField(source='user_id')
    name = serializers.CharField(source='get_name')
    email = serializers.EmailField(source='user_email')
    dob = serializers.DateField(source='user_dob')
    contactNo = serializers.CharField(source='user_mobileno')
    image = serializers.CharField(source='user_image')
    bloodGroup = serializers.CharField(source='user_blood_group')
    location =     serializers.CharField(source='user_location_id.location_name')
    profession = serializers.CharField(source='user_profession')
    fbId = serializers.CharField(source='user_fb_id')
    userId = serializers.CharField(source='user_random_id')

    class Meta:
        model = UserInfo
        # fields = ['user_id','get_name']
        fields = ["id", "name", "email", "dob", "contactNo", "image", "bloodGroup", "location", "profession", "fbId", "userId"]
</code></pre>

<p>Now when i make a create request using following code form views.py,</p>

<pre><code>def create(self, request, *args, **kwargs):
        # partial = kwargs.pop('partial', True)
        serializer = self.get_serializer(data=request.data, partial=True)
        print("kwargs------------&gt;",serializer)
        serializer.is_valid(raise_exception=True)
        self.perform_create(serializer)
        # headers = self.get_success_headers(serializer.data)
        response = {
                "status" : status.HTTP_201_CREATED,
                "message" : "User Created.",
                "response" : serializer.data
            }
        return Response(response)
</code></pre>

<p>It's giving me the following error</p>

<pre><code>IntegrityError: (1048, "Column 'user_dob' cannot be null")
</code></pre>

<p>Even after setting <strong>partial=True</strong> its not working.</p>

<p><strong>PUT</strong> request is also not working, Its not updating the data</p>

<pre><code>def update(self, request, *args, **kwargs):
        instance = self.get_object()
        serializer = self.get_serializer(instance, data=request.data, partial=True)
        # serializer = self.get_serializer(instance, data=request.data)
        serializer.is_valid(raise_exception=True)
        self.perform_update(serializer)
        response = {
                "status" : status.HTTP_200_OK,
                "message" : "User Detail Updated.",
                "response" : serializer.data
            }
        return Response(response)
</code></pre>

<p>Can anyone help me wth this?</p>

<p>Following are my post params</p>

<p><a href="http://i.stack.imgur.com/MKgah.png" rel="nofollow"><img src="http://i.stack.imgur.com/MKgah.png" alt="enter image description here"></a></p>

<p>Since you are using a serializer that maps your "user_dob" field with "dob" you should pass parameter according to name provided in serialzers.</p>

python django django-rest-framework