Django is not like instruction

how to use not like in django requests

    Model.objects.filter(keywords not like "null" or "undefined")

       select * from model where keywords not like "%undefined%"  or keywords not like "%null%";
+3
source share
1 answer

use function excludeand Qobjects

Model.objects.exclude(Q(keyword__contains='undefined') | Q(keyword__contains='null'))
+5
source

Source: https://habr.com/ru/post/1775160/


All Articles