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

Function _event_on_init

lib/sqlalchemy/orm/mapper.py:4409–4422  ·  view source on GitHub ↗

Run init_instance hooks. This also includes mapper compilation, normally not needed here but helps with some piecemeal configuration scenarios (such as in the ORM tutorial).

(state, args, kwargs)

Source from the content-addressed store, hash-verified

4407
4408
4409def _event_on_init(state, args, kwargs):
4410 """Run init_instance hooks.
4411
4412 This also includes mapper compilation, normally not needed
4413 here but helps with some piecemeal configuration
4414 scenarios (such as in the ORM tutorial).
4415
4416 """
4417
4418 instrumenting_mapper = state.manager.mapper
4419 if instrumenting_mapper:
4420 instrumenting_mapper._check_configure()
4421 if instrumenting_mapper._set_polymorphic_identity:
4422 instrumenting_mapper._set_polymorphic_identity(state)
4423
4424
4425class _ColumnMapping(Dict["ColumnElement[Any]", "MapperProperty[Any]"]):

Callers

nothing calls this directly

Calls 2

_check_configureMethod · 0.80

Tested by

no test coverage detected