from operator import and_ from django.db.models import Q categories = ['holiday', 'summer'] res = Photo.filter(reduce(and_, [Q(tags__name=c) for c in categories]))