      author = models.ForeignKey(Author)
      headline = models.CharField(max_length=50)
      pub_date = models.DateTimeField()
      categories = models.ManyToManyField(Category)
  
      class Meta:
          ordering = ('pub_date',)
  
 
</s> remove                             value = field.remote_field.model._meta.get_field(field.remote_field.field_name).to_python(field_value)
                        data[field.attname] = value
                    else:
                        data[field.attname] = field.remote_field.model._meta.get_field(field.remote_field.field_name).to_python(field_value)
 </s> add                             data[field.attname] = field.remote_field.model._meta.get_field(field.remote_field.field_name).to_python(field_value)
                    except Exception as e:
                        raise base.DeserializationError.WithData(e, d['model'], d.get('pk'), field_value) </s> remove                 data[field.name] = field.to_python(field_value)
 </s> add                 try:
                    data[field.name] = field.to_python(field_value)
                except Exception as e:
                    raise base.DeserializationError.WithData(e, d['model'], d.get('pk'), field_value) </s> remove             data[Model._meta.pk.attname] = Model._meta.pk.to_python(d.get("pk", None))
 </s> add             try:
                data[Model._meta.pk.attname] = Model._meta.pk.to_python(d.get('pk'))
            except Exception as e:
                raise base.DeserializationError.WithData(e, d['model'], d.get('pk'), None) </s> remove                     if hasattr(field.remote_field.model._default_manager, 'get_by_natural_key'):
                        if hasattr(field_value, '__iter__') and not isinstance(field_value, six.text_type):
                            obj = field.remote_field.model._default_manager.db_manager(db).get_by_natural_key(*field_value)
                            value = getattr(obj, field.remote_field.field_name)
                            # If this is a natural foreign key to an object that
                            # has a FK/O2O as the foreign key, use the FK value
                            if field.remote_field.model._meta.pk.remote_field:
                                value = value.pk
 </s> add                     try:
                        if hasattr(field.remote_field.model._default_manager, 'get_by_natural_key'):
                            if hasattr(field_value, '__iter__') and not isinstance(field_value, six.text_type):
                                obj = field.remote_field.model._default_manager.db_manager(db).get_by_natural_key(*field_value)
                                value = getattr(obj, field.remote_field.field_name)
                                # If this is a natural foreign key to an object that
                                # has a FK/O2O as the foreign key, use the FK value
                                if field.remote_field.model._meta.pk.remote_field:
                                    value = value.pk
                            else:
                                value = field.remote_field.model._meta.get_field(field.remote_field.field_name).to_python(field_value)
                            data[field.attname] = value
    meta_data = models.ManyToManyField(CategoryMetaData)
      author = models.ForeignKey(Author)
      headline = models.CharField(max_length=50)
      pub_date = models.DateTimeField()
      categories = models.ManyToManyField(Category)
    meta_data = models.ManyToManyField(CategoryMetaData)
  
      class Meta:
          ordering = ('pub_date',)
  
keep keep keep add keep keep keep keep
 Fixed #19820 -- Added more helpful error messages to Python deserializer. 
tests/serializers/models.py