title: How to Fix adding a User to a Group using Django REST framework(API)
body: <p>I'm trying to build a savings API where A user can get the list of groups available and join the group as long as it as not exceeded the maximum number of members. I've tried a series of approach but it seems not to work, anytime I try to add a user to a group, it seems like it trying to add the whole user properties.</p>
  
  <p>I made a group model and connected it to the user model via a ManytoMany field since a user can join many groups and a group can house many users. Where my problem lies in the serializer, any time I try to add a user </p>
  
  <p>groups.model</p>
  
  <pre><code>class Groups(models.Model):
      name = models.CharField(max_length = 50, unique = True)
      group_id = models.UUIDField(default = uuid.uuid4, editable = False)
      max_no_members = models.PositiveIntegerField()
      savings_amount = models.PositiveIntegerField()
      savings_type = models.CharField(max_length = 10, default = 'Monthly')
      description = models.TextField(blank=True)
      begin_date = models.DateField()
      created_date = models.DateTimeField(auto_now_add=True)
      searchable = models.BooleanField(default = True)
      members = models.ManyToManyField(User, related_name='group_members')
      created_by = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete 
      =models.CASCADE,related_name='group_admin' )
  
      def __str__(self):
          return self.name
  </code></pre>
  
  <p>groups.serializer</p>
  
  <pre><code>#List of Memebers
  class GroupMembersListSerializer(serializers.HyperlinkedModelSerializer):
      # users = UserSerializer(many=True, read_only = True)
      class Meta:
          model = Groups
          fields = ['members','name']
  
  #Join a Group
  class JoinGroupSerializer(serializers.ModelSerializer):
      users_to_join = UserSerializer(many=True, read_only = True, source = 
      'User')
      class Meta:
          model = Groups
          fields = ['members','users_to_join']
  </code></pre>
  
  <p>groups.views</p>
  
  <pre><code>#Create Group
  class GroupCreateAPIView(CreateAPIView):
      queryset = Groups.objects.all()
      serializer_class = GroupCreateSerializer
      permission_classes = [IsAuthenticated]
  
      def perform_create(self, serializer):
          serializer.save(created_by= self.request.user, members = 
          [self.request.user])
  #Members list Group
  class GroupMembersList(RetrieveAPIView):
      queryset = Groups.objects.all()
      serializer_class = GroupMembersListSerializer
  
      permission_classes = [IsAuthenticated,IsOwnerOrReadOnly]
  
  #Join Group
  class GroupJoinAPIView(CreateAPIView):
      queryset = 
      Groups.objects.annotate(arr=ArrayAgg('members')).values_list('id', 'arr')
      serializer_class = JoinGroupSerializer
  
      permission_classes = [IsAuthenticated]
  
      def perform_create(self, serializer):
          print(sys.stderr, self.queryset)
          if self.request.user.id in self.queryset.all():
              return 'User already in the group'
          else:
              list(self.queryset.all()).append(self.request.user.id)
              serializer.save()
  </code></pre>