3👍
✅
There is no easy way to do it. I’m not 100% sure, You can try something like this for your problem.
from django.models import Q
q = Q()
for tag in tags.split():
q |= Q(tags__name__iexact=tag)
Media.objects.filter(q)
Source:stackexchange.com