fix: 修复 json m2m field 中正则有问题匹配不正确

This commit is contained in:
ibuler
2023-07-20 14:46:56 +08:00
committed by Bryan
parent 19b91a6c1f
commit 08bc3d14aa
4 changed files with 18 additions and 12 deletions

View File

@@ -387,7 +387,7 @@ class RelatedManager:
lookup = "{}__{}".format(name, match)
q = Q(**{lookup: val})
except re.error:
q = ~Q()
q = Q(pk__isnull=True)
elif match == "not":
q = ~Q(**{name: val})
elif match in ['m2m', 'in']: