开发者

Django not like statement

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'))
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜