```
class Group(models.Model):
    group_name = models.CharField(max_length=256)
    group_desc = models.CharField(max_length=2000, blank=True)
    created_by = models.ForeignKey(User, on_delete=models.PROTECT, blank=True, null=True, related_name='created_groups')
    group_pic = models.ImageField(blank=True)
    users = models.ManyToManyField(User, through='GroupMember')
    created_at = models.DateTimeField(auto_now_add=True)
    updated_at = models.DateTimeField(auto_now=True)

class GroupMember(models.Model):
    group = models.ForeignKey(Group, on_delete=models.CASCADE)
    user = models.ForeignKey(User, on_delete=models.CASCADE)
    is_group_admin = models.BooleanField(default=False)

```

I have these two models and I want to query whether the request.user is part of a particular group and is group\_admin or not:

I have successfully queried the first part but not able to do the latter part. For the first part, I have written the following query:

```
GroupMember.objects.filter(id=pk, group__users__in=[request.user])

```

Any kind of help will be appreciated.