@@ -134,25 +134,17 @@ def get_cursor(self):
134
134
135
135
def join (self , compiler , connection ):
136
136
lookup_pipeline = []
137
- join_fields = self .join_fields or self .join_cols
138
137
lhs_fields = []
139
138
rhs_fields = []
140
139
# 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 ))
156
148
157
149
parent_template = "parent__field__"
158
150
lookup_pipeline = [
0 commit comments