MCPcopy
hub / github.com/ormar-orm/ormar / build_join

Method build_join

ormar/queryset/join.py:136–154  ·  view source on GitHub ↗

Main external access point for building a join. Splits the join definition, updates fields and exclude_fields if needed, handles switching to through models for m2m relations, returns updated lists of used_aliases and sort_orders. :return: list of used alias

(self)

Source from the content-addressed store, hash-verified

134 return text(f"{left_part}={right_part}")
135
136 def build_join(self) -> tuple[list, sqlalchemy.sql.Select, list, dict]:
137 """
138 Main external access point for building a join.
139 Splits the join definition, updates fields and exclude_fields if needed,
140 handles switching to through models for m2m relations, returns updated lists of
141 used_aliases and sort_orders.
142
143 :return: list of used aliases, select from, list of aliased columns, sort orders
144 :rtype: tuple[list[str], Join, list[TextClause], dict]
145 """
146 if self.target_field.is_multi:
147 self._process_m2m_through_table()
148
149 self.next_model = self.target_field.to
150 self._forward_join()
151
152 self._process_following_joins()
153
154 return (self.used_aliases, self.select_from, self.columns, self.sorted_orders)
155
156 def _forward_join(self) -> None:
157 """

Callers 2

_process_deeper_joinMethod · 0.95

Calls 3

_forward_joinMethod · 0.95

Tested by

no test coverage detected