I think you could just do `user.groups.remove(*user.groups.filter(name__in=groupnames))`