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

Function _inspect_mapped_class

lib/sqlalchemy/orm/base.py:516–529  ·  view source on GitHub ↗
(
    class_: Type[_O], configure: bool = False
)

Source from the content-addressed store, hash-verified

514
515
516def _inspect_mapped_class(
517 class_: Type[_O], configure: bool = False
518) -> Optional[Mapper[_O]]:
519 try:
520 class_manager = opt_manager_of_class(class_)
521 if class_manager is None or not class_manager.is_mapped:
522 return None
523 mapper = class_manager.mapper
524 except exc.NO_STATE:
525 return None
526 else:
527 if configure:
528 mapper._check_configure()
529 return mapper
530
531
532def _parse_mapper_argument(arg: Union[Mapper[_O], Type[_O]]) -> Mapper[_O]:

Callers 2

class_mapperFunction · 0.85
_inspect_decl_metaFunction · 0.85

Calls 2

opt_manager_of_classFunction · 0.85
_check_configureMethod · 0.80

Tested by

no test coverage detected