how to use not like in django queries
开发者_JAVA技巧 Model.objects.filter(keywords not like "null" or "undefined")
select * from model where keywords not like "%undefined%" or keywords not like "%null%";
use the exclude
function and Q
objects
Model.objects.exclude(Q(keyword__contains='undefined') | Q(keyword__contains='null'))
精彩评论