[Answered ]-Django Querysets & dynamic string filtering

0👍

__in can be used for strings as it translates to a SQL IN operation. Whether or not it is case-sensitive my depend on your table/column collation.

2👍

Your query is doing an and of all those values, and I assume you want an or? Try:

query = Q(name=groups[0])
for group in groups[1:]:
    query |= Q(name=group)

group_ids = Group.objects.filter(query)

Leave a comment