a = M.objects.filter(f__in=[None, 1])
a.query.__str__()
u'SELECT * FROM "app_m" WHERE "app_m"."f" IN (None, 1)'
你不认为会IN (NULL, 1)
吗?
喜欢:
a = M.objects.filter(f=None)
a.query.__str__()
u'SELECT * FROM "app_m" WHERE "app_m"."f" IS NULL'
这是默认的 SQL 行为、django 错误还是我遗漏了什么f__in=
?
先感谢您!