title: add new record to many to many relation in django rest framework
body: <p>I was trying to add new relation to many to many records,</p>
  
  <p>for example i have these models:</p>
  
  <p>models.py</p>
  
  <pre><code>class Team(models.Model):
      name = models.CharField(blank=True, unique=True, max_length=100)
      players = models.ManyToManyField(User, blank=True, related_name='players')
  
  
  
  class TeamInvite(models.Model):
      from_user = models.ForeignKey(User, on_delete=models.DO_NOTHING, related_name='invite_by', blank=True, null=True)
      to_user = models.ForeignKey(User, on_delete=models.DO_NOTHING, related_name='invite_to', blank=True, null=True)
      team = models.ForeignKey(Team, on_delete=models.CASCADE, related_name='invite_to_team', blank=True, null=True)
      status = models.NullBooleanField(blank=True, null=True, default=None,)
  </code></pre>
  
  <p>and my serializer:</p>
  
  <p>serializers.py </p>
  
  <pre><code>class TeamInviteCreateSerializer(serializers.ModelSerializer):
      team = serializers.PrimaryKeyRelatedField(queryset=Team.objects.all())
      from_user = serializers.PrimaryKeyRelatedField(queryset=User.objects.all())
      class Meta:
        model = TeamInvite
        fields = ('id', 'from_user', 'to_user', 'team', 'status')
  </code></pre>
  
  <p>after that the user which in to_user will take an action to TeamInvite like accept or decline.</p>
  
  <p>I need the serializer which will take the new user and add him to the existing team like the following serializer:</p>
  
  <pre><code>class TeamInviteAcceptDeclineSerializer(serializers.ModelSerializer):
      method_name = serializers.SerializerMethodField()
  
      class Meta:
          model = TeamInvite
          fields = ('id', 'from_user', 'date_time', 'team', 'method_name', 'status')
  
      def get_method_name(self, *args, **kwargs):
          method_name = None  # kwargs['context']['request'].method_name
          return method_name
  
      def update(self, instance, validated_data):
          instance.team = validated_data.get('team', instance.team)
          method_name = validated_data.get('method_name')
          instance.status = validated_data.get('status', instance.status)
          instance.to_user = validated_data.get('to_user', instance.to_user)
  
          if method_name == 'decline':
              instance.status = False
          else:
              instance.status = True
              team = Team.objects.get(pk=instance.team.pk)
              team.players.add(instance.to_user)
              # team.players.create(team_id=team, user_id=instance.to_user)
              team.save()
          instance.save()
          return instance
  </code></pre>
  
  <p><code>update</code> function does not add the user to existing team and doesn't raise any error either. What am i missing here?</p>
  
  <p>my request was:</p>
  
  <pre><code>{
      "from_user": 1,
      "to_user": 23
      "team": 64,
      "method_name": "accept",
      "status": null
  }
  </code></pre>
  
  <p>thank you</p>