          fields += [field for field in opts.many_to_many if field.serialize]
  
          ret = SortedDict()
          for model_field in fields:
              if model_field.rel and nested:
                  field = self.get_nested_field(model_field)
              elif model_field.rel:
                  field = self.get_related_field(model_field)
              else:
                  field = self.get_field(model_field)
 
</s> remove             field.initialize(parent=self, model_field=model_field)
            ret[model_field.name] = field
 </s> add             if field is not None:
                field.initialize(parent=self, model_field=model_field)
                ret[model_field.name] = field
 </s> remove         Creates a default instance of a basic field.
 </s> add         Creates a default instance of a basic non-relational field.
            if is_pk:
                field = self.get_pk_field(model_field)
                is_pk = False
            elif model_field.rel and nested:
          fields += [field for field in opts.many_to_many if field.serialize]
  
          ret = SortedDict()
          for model_field in fields:
            if is_pk:
                field = self.get_pk_field(model_field)
                is_pk = False
            elif model_field.rel and nested:
                  field = self.get_nested_field(model_field)
              elif model_field.rel:
                  field = self.get_related_field(model_field)
              else:
                  field = self.get_field(model_field)
keep keep keep keep replace keep keep keep keep keep
 Fix bug where pk could be set in post data 
rest_framework/serializers.py