📅  最后修改于: 2022-03-11 14:52:01.994000             🧑  作者: Mango
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]))