I need to make a query that returns all rows where the field subject values exist in a list. I don't matter with sensitive case, but the values should be exact with the ones in the list.
I'm using:
my_list = ["Others", "Entertainment"]
results = MyObject.objects.filter(subject__iregex=r"(" + "|".join(my_list) + ")")
This is the solution from the topic Django query case-insensitive list match but as result I have rows where:
subject = "others tv series"
and I just want rows like:
subject = "others"
I need something like iexact and in mixed.
Thanks!