Skip to content

Commit 8a2fe23

Browse files
committed
remove deprecated bits per django/django@8b1ff0d
1 parent b75351c commit 8a2fe23

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

django_mongodb/query.py

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -134,25 +134,17 @@ def get_cursor(self):
134134

135135
def join(self, compiler, connection):
136136
lookup_pipeline = []
137-
join_fields = self.join_fields or self.join_cols
138137
lhs_fields = []
139138
rhs_fields = []
140139
# Add a join condition for each pair of joining fields.
141-
for lhs, rhs in join_fields:
142-
if isinstance(lhs, str):
143-
lhs_mql = lhs
144-
rhs_mql = rhs
145-
else:
146-
lhs, rhs = connection.ops.prepare_join_on_clause(
147-
self.parent_alias, lhs, self.table_name, rhs
148-
)
149-
lhs_mql = lhs.as_mql(compiler, connection)
150-
rhs_mql = rhs.as_mql(compiler, connection)
151-
# In the lookup stage, the reference to this column doesn't include
152-
# the collection name.
153-
rhs_mql = rhs_mql.replace(f"{self.table_name}.", "", 1)
154-
lhs_fields.append(lhs_mql)
155-
rhs_fields.append(rhs_mql)
140+
for lhs, rhs in self.join_fields:
141+
lhs, rhs = connection.ops.prepare_join_on_clause(
142+
self.parent_alias, lhs, self.table_name, rhs
143+
)
144+
lhs_fields.append(lhs.as_mql(compiler, connection))
145+
# In the lookup stage, the reference to this column doesn't include
146+
# the collection name.
147+
rhs_fields.append(rhs.as_mql(compiler, connection).replace(f"{self.table_name}.", "", 1))
156148

157149
parent_template = "parent__field__"
158150
lookup_pipeline = [

0 commit comments

Comments
 (0)