MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / __init__

Method __init__

lib/sqlalchemy/orm/strategies.py:2969–2997  ·  view source on GitHub ↗
(self, parent, strategy_key)

Source from the content-addressed store, hash-verified

2967 _chunksize = 500
2968
2969 def __init__(self, parent, strategy_key):
2970 super().__init__(parent, strategy_key)
2971 self.join_depth = self.parent_property.join_depth
2972 is_m2o = self.parent_property.direction is interfaces.MANYTOONE
2973
2974 if self.parent_property.omit_join is not None:
2975 self.omit_join = self.parent_property.omit_join
2976 else:
2977 lazyloader = self.parent_property._get_strategy(
2978 (("lazy", "select"),)
2979 )
2980 if is_m2o:
2981 self.omit_join = lazyloader.use_get
2982 else:
2983 self.omit_join = self.parent._get_clause[0].compare(
2984 lazyloader._rev_lazywhere,
2985 use_proxies=True,
2986 compare_keys=False,
2987 equivalents=self.parent._equivalent_columns,
2988 )
2989
2990 if self.omit_join:
2991 if is_m2o:
2992 self._query_info = self._init_for_omit_join_m2o()
2993 self._fallback_query_info = self._init_for_join()
2994 else:
2995 self._query_info = self._init_for_omit_join()
2996 else:
2997 self._query_info = self._init_for_join()
2998
2999 def _init_for_omit_join(self):
3000 pk_to_fk = dict(

Callers

nothing calls this directly

Calls 6

_init_for_joinMethod · 0.95
_init_for_omit_joinMethod · 0.95
_get_strategyMethod · 0.80
__init__Method · 0.45
compareMethod · 0.45

Tested by

no test coverage detected