MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / __init__

Method __init__

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

Source from the content-addressed store, hash-verified

364 __slots__ = ("local_table", "inherits")
365
366 def __init__(
367 self,
368 registry: _RegistryType,
369 cls_: Type[_O],
370 table: Optional[FromClause],
371 mapper_kw: _MapperKwArgs,
372 ):
373 super().__init__(registry, cls_)
374
375 self.local_table = self.set_cls_attribute("__table__", table)
376
377 with mapperlib._CONFIGURE_MUTEX:
378 clsregistry._add_class(
379 self.classname, self.cls, registry._class_registry
380 )
381
382 self._setup_inheritance(mapper_kw)
383
384 self._early_mapping(mapper_kw)
385
386 def map(self, mapper_kw: _MapperKwArgs = util.EMPTY_DICT) -> Mapper[Any]:
387 mapper_cls = Mapper

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected