From f9d247bf14c581d2bf2c7c32f1347146494909fd Mon Sep 17 00:00:00 2001 From: M1ha Shvn Date: Tue, 23 Aug 2022 14:34:49 +0300 Subject: [PATCH] Update query.py Fixed a bug with double Q object negation: `~(~Q(condition=True))` was equal to `~Q(condition=True)` before this fix --- src/infi/clickhouse_orm/query.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/infi/clickhouse_orm/query.py b/src/infi/clickhouse_orm/query.py index 1998e2d..0c232c8 100644 --- a/src/infi/clickhouse_orm/query.py +++ b/src/infi/clickhouse_orm/query.py @@ -262,7 +262,7 @@ class Q(object): def __invert__(self): q = copy(self) - q._negate = True + q._negate = not q._negate return q def __bool__(self):