class documentation

class JoinCondition(object):

View In Hierarchy

Undocumented

Method __init__ 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 No summary
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 No summary
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
Method create​_lazy​_clause Undocumented
Method join​_targets Given a source and destination selectable, create a join between them.
Class Variable ​_track​_overlapping​_sync​_targets Undocumented
Instance Variable ​_local​_remote​_pairs Undocumented
Instance Variable ​_remote​_side Undocumented
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 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 ​_has​_foreign​_annotations Undocumented
Property ​_has​_remote​_annotations 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
def __init__(self, parent_persist_selectable, child_persist_selectable, parent_local_selectable, child_local_selectable, primaryjoin=None, secondary=None, secondaryjoin=None, parent_equivalents=None, child_equivalents=None, consider_as_foreign_keys=None, local_remote_pairs=None, remote_side=None, self_referential=False, prop=None, support_sync=True, can_be_synced_fn=(lambda *c: True)):

Undocumented

def _annotate_fks(self):
Annotate the primaryjoin and secondaryjoin structures with 'foreign' annotations marking columns considered as foreign.
def _annotate_from_fk_list(self):

Undocumented

def _annotate_local(self):

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):

Undocumented

def _annotate_present_fks(self):

Undocumented

def _annotate_remote(self):
Annotate the primaryjoin and secondaryjoin structures with 'remote' annotations marking columns considered as part of the 'remote' side.
def _annotate_remote_distinct_selectables(self):
annotate 'remote' in primaryjoin, secondaryjoin when the parent/child tables are entirely separate.
def _annotate_remote_from_args(self):
annotate 'remote' in primaryjoin, secondaryjoin when the 'remote_side' or '_local_remote_pairs' arguments are used.
def _annotate_remote_secondary(self):
annotate 'remote' in primaryjoin, secondaryjoin when 'secondary' is present.
def _annotate_remote_with_overlap(self):
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, remote_side_given):
annotate 'remote' in primaryjoin, secondaryjoin when the relationship is detected as self-referential.
def _check_foreign_cols(self, join_condition, primary):
Check the foreign key columns collected and emit error messages.
def _check_remote_side(self):

Undocumented

def _deannotate_pairs(self, collection):
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):
Determine if this relationship is one to many, many to one, many to many.
def _determine_joins(self):

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, *annotation):

Undocumented

def _gather_join_annotations(self, annotation):

Undocumented

def _has_annotation(self, clause, annotation):

Undocumented

def _log_joins(self):

Undocumented

def _refers_to_parent_table(self):
Return True if the join condition contains column comparisons where both columns are in both tables.
def _sanitize_joins(self):

remove the parententity annotation from our join conditions which can leak in here based on some declarative patterns and maybe others.

We'd want to remove "parentmapper" also, but apparently there's an exotic use case in _join_fixture_inh_selfref_w_entity that relies upon it being present, see :ticket:`3364`.

def _setup_pairs(self):

Undocumented

def _tables_overlap(self):
Return True if parent/child tables have some overlap.
def _warn_for_conflicting_sync_targets(self):

Undocumented

def _warn_non_column_elements(self):

Undocumented

def create_lazy_clause(self, reverse_direction=False):

Undocumented

def join_targets(self, source_selectable, dest_selectable, aliased, single_crit=None, extra_criteria=()):

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.

_track_overlapping_sync_targets =

Undocumented

_local_remote_pairs =

Undocumented

_remote_side =

Undocumented

can_be_synced_fn =

Undocumented

child_equivalents =

Undocumented

child_local_selectable =

Undocumented

child_persist_selectable =

Undocumented

consider_as_foreign_keys =

Undocumented

direction =

Undocumented

local_remote_pairs =

Undocumented

parent_equivalents =

Undocumented

parent_local_selectable =

Undocumented

parent_persist_selectable =

Undocumented

primaryjoin =

Undocumented

prop =

Undocumented

secondary =

Undocumented

secondary_synchronize_pairs =

Undocumented

secondaryjoin =

Undocumented

self_referential =

Undocumented

support_sync =

Undocumented

synchronize_pairs =

Undocumented

@util.memoized_property
_has_foreign_annotations =

Undocumented

@util.memoized_property
_has_remote_annotations =

Undocumented

@util.memoized_property
foreign_key_columns =

Undocumented

@util.memoized_property
local_columns =

Undocumented

@property
primaryjoin_minus_local =

Undocumented

@util.memoized_property
primaryjoin_reverse_remote =

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 =

Undocumented

@property
secondaryjoin_minus_local =

Undocumented