class documentation

represents strategy information to select for a LoaderStrategy and pass options to it. :class:`._LoadElement` objects provide the inner datastructure stored by a :class:`_orm.Load` object and are also the object passed to methods like :meth:`.LoaderStrategy.setup_query`. .. versionadded:: 2.0

Class Method create Create a new :class:`._LoadElement` object.
Method __eq__ Undocumented
Method __getstate__ Undocumented
Method __hash__ Undocumented
Method __init__ Undocumented
Method __setstate__ Undocumented
Method process_compile_state populate ORMCompileState.attributes with loader state for this _LoadElement.
Class Variable __slots__ Undocumented
Class Variable __visit_name__ Undocumented
Class Variable is_class_strategy Undocumented
Class Variable is_token_strategy Undocumented
Class Variable local_opts Undocumented
Class Variable path Undocumented
Class Variable propagate_to_loaders Undocumented
Class Variable strategy Undocumented
Property is_opts_only Undocumented
Static Method _reconcile define behavior for when two Load objects are to be put into the context.attributes under the same key.
Method _adjust_effective_path_for_current_path receives the 'current_path' entry from an :class:`.ORMCompileState` instance, which is set during lazy loads and secondary loader strategy loads, and adjusts the given path to be relative to the current_path.
Method _clone Create a shallow copy
Method _init_path Apply ORM attributes and/or wildcard to an existing path, producing a new path.
Method _prepare_for_compile_state implemented by subclasses.
Method _prepend_path_from adjust the path of this :class:`._LoadElement` to be a subpath of that of the given parent :class:`_orm.Load` object's path.
Method _raise_for_no_match Undocumented
Method _recurse Undocumented
Method _update_opts Undocumented
Class Variable _cache_key_traversal Undocumented
Class Variable _extra_criteria Undocumented
Class Variable _reconcile_to_other Undocumented
Class Variable _traverse_internals Undocumented

Inherited from HasCacheKey:

Class Variable inherit_cache Indicate if this :class:`.HasCacheKey` instance should make use of the cache key generation scheme used by its immediate superclass.
Class Method _generate_cache_attrs generate cache key dispatcher for a new class.
Class Method _generate_cache_key_for_object Undocumented
Method _gen_cache_key return an optional cache key.
Method _generate_cache_key return a cache key.
Class Variable _generated_cache_key_traversal Undocumented
Class Variable _hierarchy_supports_caching private attribute which may be set to False to prevent the inherit_cache warning from being emitted for a hierarchy of subclasses.
Class Variable _is_has_cache_key Undocumented

Inherited from HasShallowCopy (via HasCacheKey):

Class Method _generate_shallow_copy Undocumented
Class Method _generate_shallow_from_dict Undocumented
Class Method _generate_shallow_to_dict Undocumented
Method _generated_shallow_copy_traversal Undocumented
Method _generated_shallow_from_dict_traversal Undocumented
Method _generated_shallow_to_dict_traversal Undocumented
Method _shallow_copy_to Undocumented
Method _shallow_from_dict Undocumented
Method _shallow_to_dict Undocumented

Inherited from HasTraverseInternals (via HasCacheKey, HasShallowCopy):

Method get_children Return immediate child :class:`.visitors.HasTraverseInternals` elements of this :class:`.visitors.HasTraverseInternals`.
Class Variable _is_immutable Undocumented

Inherited from Visitable (via HasCacheKey, HasShallowCopy, HasTraverseInternals):

Method __class_getitem__ Undocumented
Method __init_subclass__ Undocumented
Class Method _generate_compiler_dispatch Undocumented
Method _compiler_dispatch Undocumented
Class Variable _original_compiler_dispatch Undocumented
@classmethod
def create(cls, path: PathRegistry, attr: Optional[_AttrType], strategy: Optional[_StrategyKey], wildcard_key: Optional[_WildcardKeyType], local_opts: Optional[_OptsType], propagate_to_loaders: bool, raiseerr: bool = True, attr_group: Optional[_AttrGroupType] = None, reconcile_to_other: Optional[bool] = None) -> _LoadElement: (source)

Create a new :class:`._LoadElement` object.

def __eq__(self, other): (source)

Undocumented

def __getstate__(self) -> Dict[str, Any]: (source)
def __hash__(self) -> int: (source)

Undocumented

def __init__(self): (source)

Undocumented

def __setstate__(self, state: Dict[str, Any]): (source)
def process_compile_state(self, parent_loader, compile_state, mapper_entities, reconciled_lead_entity, raiseerr): (source)

populate ORMCompileState.attributes with loader state for this _LoadElement.

local_opts: util.immutabledict[str, Any] = (source)

Undocumented

Undocumented

propagate_to_loaders: bool = (source)

Undocumented

Undocumented

@property
is_opts_only: bool = (source)

Undocumented

@staticmethod
def _reconcile(replacement: _LoadElement, existing: _LoadElement) -> _LoadElement: (source)

define behavior for when two Load objects are to be put into the context.attributes under the same key. :param replacement: ``_LoadElement`` that seeks to replace the existing one :param existing: ``_LoadElement`` that is already present.

def _adjust_effective_path_for_current_path(self, effective_path: PathRegistry, current_path: PathRegistry) -> Optional[PathRegistry]: (source)

receives the 'current_path' entry from an :class:`.ORMCompileState` instance, which is set during lazy loads and secondary loader strategy loads, and adjusts the given path to be relative to the current_path. E.g. given a loader path and current path:: lp: User -> orders -> Order -> items -> Item -> keywords -> Keyword cp: User -> orders -> Order -> items The adjusted path would be:: Item -> keywords -> Keyword

def _clone(self, **kw: Any) -> _LoadElement: (source)

Create a shallow copy

def _init_path(self, path, attr, wildcard_key, attr_group, raiseerr): (source)

Apply ORM attributes and/or wildcard to an existing path, producing a new path. This method is used within the :meth:`.create` method to initialize a :class:`._LoadElement` object.

def _prepare_for_compile_state(self, parent_loader, compile_state, mapper_entities, reconciled_lead_entity, raiseerr): (source)
def _prepend_path_from(self, parent: Union[Load, _LoadElement]) -> _LoadElement: (source)

adjust the path of this :class:`._LoadElement` to be a subpath of that of the given parent :class:`_orm.Load` object's path. This is used by the :meth:`_orm.Load._apply_to_parent` method, which is in turn part of the :meth:`_orm.Load.options` method.

def _raise_for_no_match(self, parent_loader, mapper_entities): (source)

Undocumented

def _recurse(self) -> _LoadElement: (source)

Undocumented

def _update_opts(self, **kw: Any) -> _LoadElement: (source)

Undocumented

_cache_key_traversal = (source)

Undocumented

_extra_criteria: Tuple[Any, ...] = (source)
_reconcile_to_other: Optional[bool] = (source)

Undocumented