Skip to content

Commit cd47412

Browse files
committed
Rename operators mapping.
1 parent 61db831 commit cd47412

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

django_mongodb_backend/base.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,7 @@ def range_match(a, b):
161161
raise EmptyResultSet
162162
return {"$and": conditions}
163163

164-
# match, path, find? don't know which name use.
165-
mongo_match_operators = {
164+
mongo_operators = {
166165
"exact": lambda a, b: {a: b},
167166
"gt": lambda a, b: {a: {"$gt": b}},
168167
"gte": lambda a, b: {a: {"$gte": b}},

django_mongodb_backend/lookups.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def builtin_lookup_expr(self, compiler, connection):
2121
def builtin_lookup_path(self, compiler, connection):
2222
lhs_mql = process_lhs(self, compiler, connection, as_path=True)
2323
value = process_rhs(self, compiler, connection, as_path=True)
24-
return connection.mongo_match_operators[self.lookup_name](lhs_mql, value)
24+
return connection.mongo_operators[self.lookup_name](lhs_mql, value)
2525

2626

2727
_field_resolve_expression_parameter = FieldGetDbPrepValueIterableMixin.resolve_expression_parameter
@@ -96,7 +96,7 @@ def is_null_path(self, compiler, connection):
9696
if not isinstance(self.rhs, bool):
9797
raise ValueError("The QuerySet value for an isnull lookup must be True or False.")
9898
lhs_mql = process_lhs(self, compiler, connection, as_path=True)
99-
return connection.mongo_match_operators["isnull"](lhs_mql, self.rhs)
99+
return connection.mongo_operators["isnull"](lhs_mql, self.rhs)
100100

101101

102102
# from https://www.pcre.org/current/doc/html/pcre2pattern.html#SEC4

0 commit comments

Comments
 (0)