              for key, val in attrs.items():
                  setattr(instance, key, val)
              return instance
  
          # Reverse relations
          for (obj, model) in self.opts.model._meta.get_all_related_m2m_objects_with_model():
              field_name = obj.field.related_query_name()
              if field_name in attrs:
                  self.m2m_data[field_name] = attrs.pop(field_name)
 
</s>
        # Related relations
        for (obj, model) in self.opts.model._meta.get_all_related_objects_with_model():
            field_name = obj.field.related_query_name()
            if field_name in attrs:
                self.related_data[field_name] = attrs.pop(field_name)

              for key, val in attrs.items():
                  setattr(instance, key, val)
              return instance
  
        # Related relations
        for (obj, model) in self.opts.model._meta.get_all_related_objects_with_model():
            field_name = obj.field.related_query_name()
            if field_name in attrs:
                self.related_data[field_name] = attrs.pop(field_name)

          # Reverse relations
          for (obj, model) in self.opts.model._meta.get_all_related_m2m_objects_with_model():
              field_name = obj.field.related_query_name()
              if field_name in attrs:
                  self.m2m_data[field_name] = attrs.pop(field_name)
keep keep keep add keep keep keep keep keep
 ManyPrimaryKeyRelatedField now supports create for one-to-many rel
rest_framework/serializers.py