0
如果我做的:過濾查詢集和
People.filter(name = 'Oscar', lastName = 'Mederos)
將被翻譯成類似:
SELECT ______ WHERE Name = 'Oscar' AND LastName = 'Mederos
不Django的允許做同樣的,但使用OR
代替AND
?
如果我做的:過濾查詢集和
People.filter(name = 'Oscar', lastName = 'Mederos)
將被翻譯成類似:
SELECT ______ WHERE Name = 'Oscar' AND LastName = 'Mederos
不Django的允許做同樣的,但使用OR
代替AND
?
People.objects.filter(Q(name='Oscar') | Q(lastName='Mederos'))
優秀的':)'...... – 2011-06-02 00:41:59