Skip to content

Commit ab96f25

Browse files
committed
Use join_info in a way that is compatible with Django 1 and 2
1 parent 8b8d3c2 commit ab96f25

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

psqlextra/query.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ def add_join_conditions(self, conditions: Dict[str, Any]) -> None:
6262
for name, value in conditions.items():
6363
parts = name.split(LOOKUP_SEP)
6464
join_info = self.setup_joins(parts, opts, alias, allow_many=True)
65-
self.trim_joins(join_info.targets, join_info.joins, join_info.path)
65+
self.trim_joins(join_info[1], join_info[3], join_info[4])
6666

67-
target_table = join_info.joins[-1]
68-
field = join_info.targets[-1]
67+
target_table = join_info[3][-1]
68+
field = join_info[1][-1]
6969
join = self.alias_map.get(target_table)
7070

7171
if not join:
@@ -117,7 +117,7 @@ def add_fields(self, field_names: List[str], allow_m2m: bool=True) -> bool:
117117

118118
join_info = self.setup_joins(parts, opts, alias, allow_many=allow_m2m)
119119
targets, final_alias, joins = self.trim_joins(
120-
join_info.targets, join_info.joins, join_info.path
120+
join_info[1], join_info[3], join_info[4]
121121
)
122122

123123
for target in targets:

0 commit comments

Comments
 (0)