          Create an instance of a model with a ManyToMany relationship,
          containing no items, using a representation that does not support
          lists (eg form data).
          """
          data = {'rel': ''}
          serializer = self.serializer_class(data=data)
          self.assertEquals(serializer.is_valid(), True)
          instance = serializer.save()
          self.assertEquals(len(ManyToManyModel.objects.all()), 2)
          self.assertEquals(instance.pk, 2)
 
</s> remove class ManyRelatedMixin(object):
    """
    Mixin to convert a related field to a many related field.
    """
    widget = widgets.SelectMultiple

    def field_to_native(self, obj, field_name):
        value = getattr(obj, self.source or field_name)
        return [self.to_native(item) for item in value.all()]

    def field_from_native(self, data, files, field_name, into):
        if self.read_only:
            return

        try:
            # Form data
            value = data.getlist(self.source or field_name)
        except:
            # Non-form data
            value = data.get(self.source or field_name)
        else:
            if value == ['']:
                value = []

        into[field_name] = [self.from_native(item) for item in value]


class ManyRelatedField(ManyRelatedMixin, RelatedField):
    """
    Base class for related model managers.

    If not overridden, this represents a to-many relationship, using the unicode
    representations of the target, and is read-only.
    """
    pass


 </s> add  </s> remove class ManyHyperlinkedRelatedField(ManyRelatedMixin, HyperlinkedRelatedField):
    """
    Represents a to-many relationship, using hyperlinking.
    """
    form_field_class = forms.MultipleChoiceField


 </s> add  </s> remove class ManySlugRelatedField(ManyRelatedMixin, SlugRelatedField):
    form_field_class = forms.MultipleChoiceField


 </s> add 
        data = MultiValueDict()
        data.setlist('rel', [''])
          Create an instance of a model with a ManyToMany relationship,
          containing no items, using a representation that does not support
          lists (eg form data).
          """
        data = MultiValueDict()
        data.setlist('rel', [''])
          serializer = self.serializer_class(data=data)
          self.assertEquals(serializer.is_valid(), True)
          instance = serializer.save()
          self.assertEquals(len(ManyToManyModel.objects.all()), 2)
          self.assertEquals(instance.pk, 2)
keep keep keep keep replace keep keep keep keep keep
 Starting migration from ManyField to Field(many=True) 
rest_framework/tests/serializer.py