human
In Django, how do I check if a user is in a certain group?
assistant
Here is some code to check if a user `user` is in a group from list of groups `['group1', 'group2']`

return user.groups.filter(name__in=['group1', 'group2']).exists()

#Warning: this code generation is experimental. Please inspect the code for any bugs before executing.