MCPcopy
hub / github.com/django/django / _setup_joins

Method _setup_joins

django/db/models/sql/compiler.py:1125–1138  ·  view source on GitHub ↗

Helper method for get_order_by() and get_distinct(). get_ordering() and get_distinct() must produce same target columns on same input, as the prefixes of get_ordering() and get_distinct() must match. Executing SQL where this is not true is an error.

(self, pieces, opts, alias)

Source from the content-addressed store, hash-verified

1123 ]
1124
1125 def _setup_joins(self, pieces, opts, alias):
1126 """
1127 Helper method for get_order_by() and get_distinct().
1128
1129 get_ordering() and get_distinct() must produce same target columns on
1130 same input, as the prefixes of get_ordering() and get_distinct() must
1131 match. Executing SQL where this is not true is an error.
1132 """
1133 alias = alias or self.query.get_initial_alias()
1134 field, targets, opts, joins, path, transform_function = self.query.setup_joins(
1135 pieces, opts, alias
1136 )
1137 alias = joins[-1]
1138 return field, targets, alias, joins, path, opts, transform_function
1139
1140 def get_from_clause(self):
1141 """

Callers 2

get_distinctMethod · 0.95
find_ordering_nameMethod · 0.95

Calls 2

get_initial_aliasMethod · 0.80
setup_joinsMethod · 0.80

Tested by

no test coverage detected