📜  django 查询集中的或运算符 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:44.368000             🧑  作者: Mango

代码示例1
from django.db.models import Q

Contact.objects.filter(Q(last_name__icontains=request.POST['query']) | 
                               Q(first_name__icontains=request.POST['query']))