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)
| 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 | """ |
no test coverage detected