标签: django django-models
如果我这样做:
People.filter(name = 'Oscar', lastName = 'Mederos)
它将被翻译成:
SELECT ______ WHERE Name = 'Oscar' AND LastName = 'Mederos
Django允许使用OR代替AND吗?
OR
AND
答案 0 :(得分:6)
Q objects
Q
People.objects.filter(Q(name='Oscar') | Q(lastName='Mederos'))