18
18
from django_mongodb .query_utils import process_lhs , process_rhs
19
19
20
20
21
- def _key_transform_root (self , compiler , connection ):
22
- previous = self .lhs
23
- while isinstance (previous , KeyTransform ):
24
- previous = previous .lhs
25
- return previous .as_mql (compiler , connection )
26
-
27
-
28
21
def contained_by (self , compiler , connection ): # noqa: ARG001
29
22
raise NotSupportedError ("contained_by lookup is not supported on this database backend." )
30
23
@@ -38,7 +31,7 @@ def data_contains(self, compiler, connection): # noqa: ARG001
38
31
39
32
def from_db_value (self , value , expression , connection ):
40
33
"""
41
- Mongodb does not need to change the json value. It is store as it is.
34
+ MongoDB does not need to change the json value. It is stored as it is.
42
35
"""
43
36
return (
44
37
value
@@ -122,6 +115,13 @@ def key_transform_in(self, compiler, connection):
122
115
return {"$and" : [expr , type_in ]}
123
116
124
117
118
+ def _key_transform_root (self , compiler , connection ):
119
+ previous = self .lhs
120
+ while isinstance (previous , KeyTransform ):
121
+ previous = previous .lhs
122
+ return previous .as_mql (compiler , connection )
123
+
124
+
125
125
def key_transform_isnull (self , compiler , connection ):
126
126
"""
127
127
The KeyTransformIsNull lookup borrows the logic from HasKey for isnull=False.
0 commit comments