how to use not like in django queries
Model.objects.filter(keywords not like "null" or "undefined")
select * from model where keywords not like "%undefined%" or keywords not like "%null%";
how to use not like in django queries
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'))