          If there are many to many fields present on the instance then they
          cannot be set until the model is instantiated, in which case the
          implementation is like so:
  
              example_relationship = validated_attrs.pop('example_relationship')
              instance = ExampleModel.objects.create(**validated_attrs)
              instance.example_relationship = example_relationship
              return instance
  
          The default implementation also does not handle nested relationships.
          If you want to support writable nested relationships you'll need
 
</s> remove             return ExampleModel.objects.create(**validated_attrs)
 </s> add             return ExampleModel.objects.create(**validated_data) </s> remove         # Remove many-to-many relationships from validated_attrs.
 </s> add         # Remove many-to-many relationships from validated_data. </s> remove             instance = ModelClass.objects.create(**validated_attrs)
 </s> add             instance = ModelClass.objects.create(**validated_data) </s> remove     def update(self, instance, validated_attrs):
 </s> add     def update(self, instance, validated_data): </s> remove             if relation_info.to_many and (field_name in validated_attrs):
                many_to_many[field_name] = validated_attrs.pop(field_name)
 </s> add             if relation_info.to_many and (field_name in validated_data):
                many_to_many[field_name] = validated_data.pop(field_name)
            example_relationship = validated_data.pop('example_relationship')
            instance = ExampleModel.objects.create(**validated_data)
          If there are many to many fields present on the instance then they
          cannot be set until the model is instantiated, in which case the
          implementation is like so:
  
            example_relationship = validated_data.pop('example_relationship')
            instance = ExampleModel.objects.create(**validated_data)
            example_relationship = validated_data.pop('example_relationship')
            instance = ExampleModel.objects.create(**validated_data)
              instance.example_relationship = example_relationship
              return instance
  
          The default implementation also does not handle nested relationships.
          If you want to support writable nested relationships you'll need
keep keep keep keep replace replace keep keep keep keep keep
 Renamed validated_attrs to validated_data to be more in line with other similar code. 
rest_framework/serializers.py