I am doing tag search function, user could observe a lot of tags, I get it all in one tuple, and now I would like to find all text which include at least one tag from the list.
Here you go:
filter = Q() for t in tag_tuple: filter = filter | Q(data__contains=t) return text.objects.filter(filter)
A couple of tips:
Text
text
__icontains