class _UnboundLoad(Load):
Represent a loader option that isn't tied to a root entity.
The loader option will produce an entity-linked _orm.Load
object when it is passed _query.Query.options
.
This provides compatibility with the traditional system of freestanding options, e.g. joinedload('x.y.z').
Class Method | _from_keys |
Undocumented |
Method | __getstate__ |
Undocumented |
Method | __init__ |
Undocumented |
Method | __setstate__ |
Undocumented |
Method | _apply_to_parent |
Undocumented |
Method | _bind_loader |
Convert from an _UnboundLoad() object into a Load() object. |
Method | _chop_path |
Undocumented |
Method | _deep_clone |
Undocumented |
Method | _find_entity_basestring |
Undocumented |
Method | _find_entity_prop_comparator |
Undocumented |
Method | _gen_cache_key |
Inlined gen_cache_key |
Method | _generate_path |
Undocumented |
Method | _process |
Undocumented |
Method | _serialize_path |
Undocumented |
Method | _set_path_strategy |
Undocumented |
Class Variable | _is_chain_link |
Undocumented |
Instance Variable | __dict__ |
Undocumented |
Instance Variable | _extra_criteria |
Undocumented |
Instance Variable | _to_bind |
Undocumented |
Instance Variable | local_opts |
Undocumented |
Instance Variable | path |
Undocumented |
Instance Variable | propagate_to_loaders |
if True, indicate this option should be carried along to "secondary" SELECT statements that occur for relationship lazy loaders as well as attribute load / refresh operations. |
Inherited from Load
:
Class Method | for_existing_path |
Undocumented |
Method | __str__ |
Undocumented |
Method | _adjust_for_extra_criteria |
Apply the current bound parameters in a QueryContext to all occurrences "extra_criteria" stored within al this Load object; copying in place. |
Method | _clone_for_bind_strategy |
No summary |
Method | _coerce_strat |
Undocumented |
Method | _generate |
Undocumented |
Method | _generate_extra_criteria |
Apply the current bound parameters in a QueryContext to the immediate "extra_criteria" stored with this Load object. |
Method | _set_for_path |
Undocumented |
Method | options |
Apply a series of options as sub-options to this _orm.Load object. |
Method | process_compile_state |
Apply a modification to a given .CompileState . |
Method | process_compile_state_replaced_entities |
Apply a modification to a given .CompileState , given entities that were replaced by with_only_columns() or with_entities(). |
Method | set_class_strategy |
Undocumented |
Method | set_column_strategy |
Undocumented |
Method | set_generic_strategy |
Undocumented |
Method | set_relationship_strategy |
Undocumented |
Class Variable | _cache_key_traversal |
Undocumented |
Class Variable | _is_strategy_option |
Undocumented |
Class Variable | is_opts_only |
Undocumented |
Class Variable | strategy |
Undocumented |
Instance Variable | _of_type |
Undocumented |
Instance Variable | context |
Undocumented |
Instance Variable | is_class_strategy |
Undocumented |
Property | _context_cache_key |
Undocumented |
Inherited from CompileStateOption
(via Load
, LoaderOption
):
Class Variable | _is_compile_state |
Undocumented |
Inherited from HasCacheKey
(via Load
, LoaderOption
, CompileStateOption
):
Class Variable | inherit_cache |
Indicate if this .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 | _generate_cache_key |
return a cache key. |
Class Variable | __slots__ |
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 ORMOption
(via Load
, LoaderOption
, CompileStateOption
):
Class Variable | __slots__ |
Undocumented |
Class Variable | _is_criteria_option |
Undocumented |
Class Variable | _is_legacy_option |
Undocumented |
Inherited from ExecutableOption
(via Load
, LoaderOption
, CompileStateOption
, ORMOption
):
Method | _clone |
Create a shallow copy of this ExecutableOption. |
Class Variable | __visit_name__ |
Undocumented |
Class Variable | _is_has_cache_key |
Undocumented |
Inherited from HasCopyInternals
(via Load
, LoaderOption
, CompileStateOption
, ORMOption
, ExecutableOption
):
Method | _copy_internals |
Reassign internal elements to be clones of themselves. |
Convert from an _UnboundLoad() object into a Load() object.
The _UnboundLoad() uses an informal "path" and does not necessarily refer to a lead entity as it may use string tokens. The Load() OTOH refers to a complete path. This method reconciles from a given Query into a Load.
Example:
query = session.query(User).options( joinedload("orders").joinedload("items"))
The above options will be an _UnboundLoad object along the lines of (note this is not the exact API of _UnboundLoad):
_UnboundLoad( _to_bind=[ _UnboundLoad(["orders"], {"lazy": "joined"}), _UnboundLoad(["orders", "items"], {"lazy": "joined"}), ] )
After this method, we get something more like this (again this is not exact API):
Load( User, (User, User.orders.property)) Load( User, (User, User.orders.property, Order, Order.items.property))
Inlined gen_cache_key
Original traversal is:
_cache_key_traversal = [ ("path", visitors.ExtendedInternalTraversal.dp_multi_list), ("strategy", visitors.ExtendedInternalTraversal.dp_plain_obj), ( "_to_bind", visitors.ExtendedInternalTraversal.dp_has_cache_key_list, ), ( "_extra_criteria", visitors.InternalTraversal.dp_clauseelement_list), ( "local_opts", visitors.ExtendedInternalTraversal.dp_string_multi_dict, ), ]
The inlining is so that the "_to_bind" list can be flattened to not repeat the same UnboundLoad options over and over again.
See #6869