我正在寻找正确的语法:
SomeModel.objects.filter(propertyA = 'foo' OR propertyB = 'bar')
这里正确的语法是什么?
请您参考如下方法:
看这里:https://docs.djangoproject.com/en/dev/topics/db/queries/#complex-lookups-with-q-objects
应该是:
from django.db.models import Q
SomeModel.objects.filter(Q(propertyA=foo) | Q(propertyB=bar))
