summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2017-06-13 14:16:52 -0400
committerTim Graham <timograham@gmail.com>2017-06-13 14:17:45 -0400
commit31d7fc85410c81932a42c4d5bb84759fd9f4a295 (patch)
treee8d94a58eb47d889dc2894cabc57cb4ae6b77896
parent16431b03f801788d791bbb24d6fb266c3591ab07 (diff)
[1.11.x] Refs #23853 -- Updated sql.query.Query.join() docstring.
Follow up to ab89414f40db1598364a7fe4cfac1766cacd2668. Backport of 7acbe89cc2a72f1b85d415c1cdb622c0dbbbe37c from master
-rw-r--r--django/db/models/sql/query.py25
1 files changed, 7 insertions, 18 deletions
diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py
index 6b3dc4a3e9..e2d273994e 100644
--- a/django/db/models/sql/query.py
+++ b/django/db/models/sql/query.py
@@ -902,27 +902,16 @@ class Query(object):
def join(self, join, reuse=None):
"""
- Returns an alias for the join in 'connection', either reusing an
- existing alias for that join or creating a new one. 'connection' is a
- tuple (lhs, table, join_cols) where 'lhs' is either an existing
- table alias or a table name. 'join_cols' is a tuple of tuples containing
- columns to join on ((l_id1, r_id1), (l_id2, r_id2)). The join corresponds
- to the SQL equivalent of::
+ Return an alias for the 'join', either reusing an existing alias for
+ that join or creating a new one. 'join' is either a
+ sql.datastructures.BaseTable or Join.
- lhs.l_id1 = table.r_id1 AND lhs.l_id2 = table.r_id2
-
- The 'reuse' parameter can be either None which means all joins
- (matching the connection) are reusable, or it can be a set containing
- the aliases that can be reused.
+ The 'reuse' parameter can be either None which means all joins are
+ reusable, or it can be a set containing the aliases that can be reused.
A join is always created as LOUTER if the lhs alias is LOUTER to make
- sure we do not generate chains like t1 LOUTER t2 INNER t3. All new
- joins are created as LOUTER if nullable is True.
-
- If 'nullable' is True, the join can potentially involve NULL values and
- is a candidate for promotion (to "left outer") when combining querysets.
-
- The 'join_field' is the field we are joining along (if any).
+ sure chains like t1 LOUTER t2 INNER t3 aren't generated. All new
+ joins are created as LOUTER if the join is nullable.
"""
reuse = [a for a, j in self.alias_map.items()
if (reuse is None or a in reuse) and j == join]