given a list of mappers (assumed to be within this mapper's inheritance hierarchy), construct an outerjoin amongst those mapper's mapped tables.
(
self, mappers: Iterable[Mapper[Any]], innerjoin: bool
)
| 2536 | return mappers |
| 2537 | |
| 2538 | def _selectable_from_mappers( |
| 2539 | self, mappers: Iterable[Mapper[Any]], innerjoin: bool |
| 2540 | ) -> FromClause: |
| 2541 | """given a list of mappers (assumed to be within this mapper's |
| 2542 | inheritance hierarchy), construct an outerjoin amongst those mapper's |
| 2543 | mapped tables. |
| 2544 | |
| 2545 | """ |
| 2546 | from_obj = self.persist_selectable |
| 2547 | for m in mappers: |
| 2548 | if m is self: |
| 2549 | continue |
| 2550 | if m.concrete: |
| 2551 | raise sa_exc.InvalidRequestError( |
| 2552 | "'with_polymorphic()' requires 'selectable' argument " |
| 2553 | "when concrete-inheriting mappers are used." |
| 2554 | ) |
| 2555 | elif not m.single: |
| 2556 | if innerjoin: |
| 2557 | from_obj = from_obj.join( |
| 2558 | m.local_table, m.inherit_condition |
| 2559 | ) |
| 2560 | else: |
| 2561 | from_obj = from_obj.outerjoin( |
| 2562 | m.local_table, m.inherit_condition |
| 2563 | ) |
| 2564 | |
| 2565 | return from_obj |
| 2566 | |
| 2567 | @HasMemoized.memoized_attribute |
| 2568 | def _version_id_has_server_side_value(self) -> bool: |
no test coverage detected