class documentation

class PathRegistry(HasCacheKey):

Known subclasses: sqlalchemy.orm.path_registry.AbstractEntityRegistry, sqlalchemy.orm.path_registry.PropRegistry, sqlalchemy.orm.path_registry.RootRegistry, sqlalchemy.orm.path_registry.TokenRegistry

View In Hierarchy

Represent query load paths and registry functions.

Basically represents structures like:

(<User mapper>, "orders", <Order mapper>, "items", <Item mapper>)

These structures are generated by things like query options (joinedload(), subqueryload(), etc.) and are used to compose keys stored in the query._attributes dictionary for various options.

They are then re-composed at query compile/result row time as the query is formed and as rows are fetched, where they again serve to compose keys to look up options in the context.attributes dictionary, which is copied from query._attributes.

The path structure has a limited amount of caching, where each "root" ultimately pulls from a fixed registry associated with the first mapper, that also contains elements for each of its property keys. However paths longer than two elements, which are the exception rather than the rule, are generated on an as-needed basis.

Class Method coerce Undocumented
Class Method deserialize Undocumented
Class Method deserialize​_context​_dict Undocumented
Class Method per​_mapper Undocumented
Class Method serialize​_context​_dict Undocumented
Class Method ​_deserialize​_path Undocumented
Class Method ​_serialize​_path Undocumented
Method __add__ Undocumented
Method __eq__ Undocumented
Method __hash__ Undocumented
Method __len__ Undocumented
Method __ne__ Undocumented
Method __reduce__ Undocumented
Method __repr__ Undocumented
Method contains Undocumented
Method contains​_mapper Undocumented
Method get Undocumented
Method pairs Undocumented
Method serialize Undocumented
Method set Undocumented
Method setdefault Undocumented
Method token Undocumented
Class Variable __slots__ Undocumented
Class Variable ​_cache​_key​_traversal Undocumented
Class Variable is​_root Undocumented
Class Variable is​_token Undocumented
Property ​_path​_for​_compare Undocumented
Property length Undocumented

Inherited from HasCacheKey:

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 ​_gen​_cache​_key return an optional cache key.
Method ​_generate​_cache​_key return a cache key.
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
@classmethod
def coerce(cls, raw):

Undocumented

@classmethod
def deserialize(cls, path):

Undocumented

@classmethod
def deserialize_context_dict(cls, serialized):

Undocumented

@classmethod
def per_mapper(cls, mapper):

Undocumented

@classmethod
def serialize_context_dict(cls, dict_, tokens):

Undocumented

@classmethod
def _deserialize_path(cls, path):

Undocumented

@classmethod
def _serialize_path(cls, path):

Undocumented

def __add__(self, other):

Undocumented

def __eq__(self, other):

Undocumented

def __hash__(self):

Undocumented

def __len__(self):

Undocumented

def __ne__(self, other):

Undocumented

def __reduce__(self):

Undocumented

def __repr__(self):

Undocumented

def contains(self, attributes, key):

Undocumented

def contains_mapper(self, mapper):

Undocumented

def get(self, attributes, key, value=None):

Undocumented

def pairs(self):

Undocumented

def serialize(self):

Undocumented

def set(self, attributes, key, value):

Undocumented

def setdefault(self, attributes, key, value):

Undocumented

def token(self, token):

Undocumented

_cache_key_traversal =

Undocumented

is_root: bool =

Undocumented

is_token: bool =

Undocumented

@property
_path_for_compare =

Undocumented

@property
length =

Undocumented