class documentation

class JoinCondition: (source)

View In Hierarchy

Undocumented

Method __init__ Undocumented
Method create_lazy_clause Undocumented
Method join_targets Given a source and destination selectable, create a join between them.
Instance Variable can_be_synced_fn Undocumented
Instance Variable child_equivalents Undocumented
Instance Variable child_local_selectable Undocumented
Instance Variable child_persist_selectable Undocumented
Instance Variable consider_as_foreign_keys Undocumented
Instance Variable direction Undocumented
Instance Variable local_remote_pairs Undocumented
Instance Variable parent_equivalents Undocumented
Instance Variable parent_local_selectable Undocumented
Instance Variable parent_persist_selectable Undocumented
Instance Variable primaryjoin Undocumented
Instance Variable primaryjoin_initial Undocumented
Instance Variable prop Undocumented
Instance Variable secondary Undocumented
Instance Variable secondary_synchronize_pairs Undocumented
Instance Variable secondaryjoin Undocumented
Instance Variable self_referential Undocumented
Instance Variable support_sync Undocumented
Instance Variable synchronize_pairs Undocumented
Property foreign_key_columns Undocumented
Property local_columns Undocumented
Property primaryjoin_minus_local Undocumented
Property primaryjoin_reverse_remote Return the primaryjoin condition suitable for the "reverse" direction.
Property remote_columns Undocumented
Property secondaryjoin_minus_local Undocumented
Method _annotate_fks Annotate the primaryjoin and secondaryjoin structures with 'foreign' annotations marking columns considered as foreign.
Method _annotate_from_fk_list Undocumented
Method _annotate_local Annotate the primaryjoin and secondaryjoin structures with 'local' annotations.
Method _annotate_parentmapper Undocumented
Method _annotate_present_fks Undocumented
Method _annotate_remote Annotate the primaryjoin and secondaryjoin structures with 'remote' annotations marking columns considered as part of the 'remote' side.
Method _annotate_remote_distinct_selectables annotate 'remote' in primaryjoin, secondaryjoin when the parent/child tables are entirely separate.
Method _annotate_remote_from_args annotate 'remote' in primaryjoin, secondaryjoin when the 'remote_side' or '_local_remote_pairs' arguments are used.
Method _annotate_remote_secondary annotate 'remote' in primaryjoin, secondaryjoin when 'secondary' is present.
Method _annotate_remote_with_overlap annotate 'remote' in primaryjoin, secondaryjoin when the parent/child tables have some set of tables in common, though is not a fully self-referential relationship.
Method _annotate_selfref annotate 'remote' in primaryjoin, secondaryjoin when the relationship is detected as self-referential.
Method _check_foreign_cols Check the foreign key columns collected and emit error messages.
Method _check_remote_side Undocumented
Method _deannotate_pairs provide deannotation for the various lists of pairs, so that using them in hashes doesn't incur high-overhead __eq__() comparisons against original columns mapped.
Method _determine_direction Determine if this relationship is one to many, many to one, many to many.
Method _determine_joins Determine the 'primaryjoin' and 'secondaryjoin' attributes, if not passed to the constructor already.
Method _gather_columns_with_annotation Undocumented
Method _gather_join_annotations Undocumented
Method _has_annotation Undocumented
Method _log_joins Undocumented
Method _refers_to_parent_table Return True if the join condition contains column comparisons where both columns are in both tables.
Method _sanitize_joins remove the parententity annotation from our join conditions which can leak in here based on some declarative patterns and maybe others.
Method _setup_pairs Undocumented
Method _tables_overlap Return True if parent/child tables have some overlap.
Method _warn_for_conflicting_sync_targets Undocumented
Method _warn_non_column_elements Undocumented
Class Variable _track_overlapping_sync_targets Undocumented
Instance Variable _local_remote_pairs Undocumented
Instance Variable _remote_side Undocumented
Property _has_foreign_annotations Undocumented
Property _has_remote_annotations Undocumented
def __init__(self, parent_persist_selectable: FromClause, child_persist_selectable: FromClause, parent_local_selectable: FromClause, child_local_selectable: FromClause, *, primaryjoin: Optional[ColumnElement[bool]] = None, secondary: Optional[FromClause] = None, secondaryjoin: Optional[ColumnElement[bool]] = None, parent_equivalents: Optional[_EquivalentColumnMap] = None, child_equivalents: Optional[_EquivalentColumnMap] = None, consider_as_foreign_keys: Any = None, local_remote_pairs: Optional[_ColumnPairs] = None, remote_side: Any = None, self_referential: Any = False, prop: RelationshipProperty[Any], support_sync: bool = True, can_be_synced_fn: Callable[..., bool] = (lambda *c: True)): (source)

Undocumented

def create_lazy_clause(self, reverse_direction: bool = False) -> Tuple[ColumnElement[bool], Dict[str, ColumnElement[Any]], Dict[ColumnElement[Any], ColumnElement[Any]]]: (source)

Undocumented

def join_targets(self, source_selectable: Optional[FromClause], dest_selectable: FromClause, aliased: bool, single_crit: Optional[ColumnElement[bool]] = None, extra_criteria: Tuple[ColumnElement[bool], ...] = ()) -> Tuple[ColumnElement[bool], Optional[ColumnElement[bool]], Optional[FromClause], Optional[ClauseAdapter], FromClause]: (source)

Given a source and destination selectable, create a join between them. This takes into account aliasing the join clause to reference the appropriate corresponding columns in the target objects, as well as the extra child criterion, equivalent column sets, etc.

can_be_synced_fn = (source)

Undocumented

child_equivalents = (source)

Undocumented

child_local_selectable = (source)

Undocumented

child_persist_selectable = (source)

Undocumented

consider_as_foreign_keys = (source)

Undocumented

direction = (source)

Undocumented

local_remote_pairs = (source)

Undocumented

parent_equivalents = (source)

Undocumented

parent_local_selectable = (source)

Undocumented

parent_persist_selectable = (source)

Undocumented

primaryjoin = (source)

Undocumented

primaryjoin_initial = (source)

Undocumented

Undocumented

secondary = (source)

Undocumented

secondary_synchronize_pairs = (source)

Undocumented

secondaryjoin = (source)

Undocumented

self_referential = (source)

Undocumented

support_sync = (source)

Undocumented

synchronize_pairs = (source)

Undocumented

@util.memoized_property
foreign_key_columns: Set[ColumnElement[Any]] = (source)

Undocumented

@util.memoized_property
local_columns: Set[ColumnElement[Any]] = (source)

Undocumented

@property
primaryjoin_minus_local: ColumnElement[bool] = (source)

Undocumented

@util.memoized_property
primaryjoin_reverse_remote: ColumnElement[bool] = (source)

Return the primaryjoin condition suitable for the "reverse" direction. If the primaryjoin was delivered here with pre-existing "remote" annotations, the local/remote annotations are reversed. Otherwise, the local/remote annotations are removed.

@util.memoized_property
remote_columns: Set[ColumnElement[Any]] = (source)

Undocumented

@property
secondaryjoin_minus_local: ColumnElement[bool] = (source)

Undocumented

def _annotate_fks(self): (source)

Annotate the primaryjoin and secondaryjoin structures with 'foreign' annotations marking columns considered as foreign.

def _annotate_from_fk_list(self): (source)

Undocumented

def _annotate_local(self): (source)

Annotate the primaryjoin and secondaryjoin structures with 'local' annotations. This annotates all column elements found simultaneously in the parent table and the join condition that don't have a 'remote' annotation set up from _annotate_remote() or user-defined.

def _annotate_parentmapper(self): (source)

Undocumented

def _annotate_present_fks(self): (source)

Undocumented

def _annotate_remote(self): (source)

Annotate the primaryjoin and secondaryjoin structures with 'remote' annotations marking columns considered as part of the 'remote' side.

def _annotate_remote_distinct_selectables(self): (source)

annotate 'remote' in primaryjoin, secondaryjoin when the parent/child tables are entirely separate.

def _annotate_remote_from_args(self): (source)

annotate 'remote' in primaryjoin, secondaryjoin when the 'remote_side' or '_local_remote_pairs' arguments are used.

def _annotate_remote_secondary(self): (source)

annotate 'remote' in primaryjoin, secondaryjoin when 'secondary' is present.

def _annotate_remote_with_overlap(self): (source)

annotate 'remote' in primaryjoin, secondaryjoin when the parent/child tables have some set of tables in common, though is not a fully self-referential relationship.

def _annotate_selfref(self, fn: Callable[[ColumnElement[Any]], bool], remote_side_given: bool): (source)

annotate 'remote' in primaryjoin, secondaryjoin when the relationship is detected as self-referential.

def _check_foreign_cols(self, join_condition: ColumnElement[bool], primary: bool): (source)

Check the foreign key columns collected and emit error messages.

def _check_remote_side(self): (source)

Undocumented

def _deannotate_pairs(self, collection: _ColumnPairIterable) -> _MutableColumnPairs: (source)

provide deannotation for the various lists of pairs, so that using them in hashes doesn't incur high-overhead __eq__() comparisons against original columns mapped.

def _determine_direction(self): (source)

Determine if this relationship is one to many, many to one, many to many.

def _determine_joins(self): (source)

Determine the 'primaryjoin' and 'secondaryjoin' attributes, if not passed to the constructor already. This is based on analysis of the foreign key relationships between the parent and target mapped selectables.

def _gather_columns_with_annotation(self, clause: ColumnElement[Any], *annotation: Iterable[str]) -> Set[ColumnElement[Any]]: (source)

Undocumented

def _gather_join_annotations(self, annotation: str) -> Set[ColumnElement[Any]]: (source)

Undocumented

def _has_annotation(self, clause: ClauseElement, annotation: str) -> bool: (source)

Undocumented

def _log_joins(self): (source)

Undocumented

def _refers_to_parent_table(self) -> bool: (source)

Return True if the join condition contains column comparisons where both columns are in both tables.

def _sanitize_joins(self): (source)

remove the parententity annotation from our join conditions which can leak in here based on some declarative patterns and maybe others. "parentmapper" is relied upon both by the ORM evaluator as well as the use case in _join_fixture_inh_selfref_w_entity that relies upon it being present, see :ticket:`3364`.

def _setup_pairs(self): (source)

Undocumented

def _tables_overlap(self) -> bool: (source)

Return True if parent/child tables have some overlap.

def _warn_for_conflicting_sync_targets(self): (source)

Undocumented

def _warn_non_column_elements(self): (source)

Undocumented

_local_remote_pairs = (source)

Undocumented

_remote_side = (source)

Undocumented

@util.memoized_property
_has_foreign_annotations: bool = (source)

Undocumented

@util.memoized_property
_has_remote_annotations: bool = (source)

Undocumented