MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _event_on_init

Function _event_on_init

lib/sqlalchemy/orm/mapper.py:4404–4417  ·  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

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

Callers

nothing calls this directly

Calls 2

_check_configureMethod · 0.80

Tested by

no test coverage detected