如何使用不像django查询
Model.objects.filter(keywords not like "null" or "undefined")
select * from model where keywords not like "%undefined%" or keywords not like "%null%";
答案 0 :(得分:7)
使用exclude
函数和Q
对象
Model.objects.exclude(Q(keyword__contains='undefined') | Q(keyword__contains='null'))