📜  django 过滤多个字段 - Python 代码示例

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

代码示例1
# Will return rows with 1 or 6 in colA and 'yourValue' in colB
YourModel.objects.filter(colA__in=[1,8],colB='yourValue')

# Will return rows with 1 or 6 in colA OR
# potentially different rows with 'yourValue' in colB
YourModel.objects.filter(colA__in=[1,8]).filter(colB='yourValue')