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

Function _dive_for_cls_manager

lib/sqlalchemy/orm/decl_base.py:218–229  ·  view source on GitHub ↗
(cls: Type[_O])

Source from the content-addressed store, hash-verified

216
217
218def _dive_for_cls_manager(cls: Type[_O]) -> Optional[ClassManager[_O]]:
219 # because the class manager registration is pluggable,
220 # we need to do the search for every class in the hierarchy,
221 # rather than just a simple "cls._sa_class_manager"
222
223 for base in cls.__mro__:
224 manager: Optional[ClassManager[_O]] = attributes.opt_manager_of_class(
225 base
226 )
227 if manager:
228 return manager
229 return None
230
231
232@util.preload_module("sqlalchemy.orm.decl_api")

Callers 2

_get_immediate_cls_attrFunction · 0.85

Calls 1

opt_manager_of_classMethod · 0.80

Tested by

no test coverage detected