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

Method __init__

lib/sqlalchemy/orm/decl_base.py:373–392  ·  view source on GitHub ↗
(
        self,
        registry: _RegistryType,
        cls_: Type[_O],
        table: Optional[FromClause],
        mapper_kw: _MapperKwArgs,
    )

Source from the content-addressed store, hash-verified

371 __slots__ = ("local_table", "inherits")
372
373 def __init__(
374 self,
375 registry: _RegistryType,
376 cls_: Type[_O],
377 table: Optional[FromClause],
378 mapper_kw: _MapperKwArgs,
379 ):
380 super().__init__(registry, cls_, mapper_kw)
381
382 self.local_table = self.set_cls_attribute("__table__", table)
383
384 with mapperlib._CONFIGURE_MUTEX:
385 if not mapper_kw.get("non_primary", False):
386 clsregistry.add_class(
387 self.classname, self.cls, registry._class_registry
388 )
389
390 self._setup_inheritance(mapper_kw)
391
392 self._early_mapping(mapper_kw)
393
394 def map(self, mapper_kw: _MapperKwArgs = util.EMPTY_DICT) -> Mapper[Any]:
395 mapper_cls = Mapper

Callers

nothing calls this directly

Calls 6

_setup_inheritanceMethod · 0.95
set_cls_attributeMethod · 0.80
add_classMethod · 0.80
__init__Method · 0.45
getMethod · 0.45
_early_mappingMethod · 0.45

Tested by

no test coverage detected