Q类的用法
from django.db.models import Q q = Q() q.children.append(("username", "lyj")) q.children.append(("age", "18")) #如果不设置,默认是 and q.connector = "or" res = User.objects.filter(q)
原文地址:https://www.cnblogs.com/95lyj/p/9377039.html
时间: 2024-11-09 03:16:25