1👍
✅
__contains is used for case-sensitive containment search (https://docs.djangoproject.com/en/dev/ref/models/querysets/#contains), you just need plain id equality match:
raid_teams = Team.objects.filter(
Q(tanks__id=profile.pk) |
Q(healers__id=profile.pk) |
Q(dps__id=profile.pk)
)
Source:stackexchange.com