MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / after_configured

Method after_configured

lib/sqlalchemy/orm/events.py:1117–1162  ·  view source on GitHub ↗

Called after a series of mappers have been configured. The :meth:`.MapperEvents.after_configured` event is invoked each time the :func:`_orm.configure_mappers` function is invoked, after the function has completed its work. :func:`_orm.configure_mappers` is typically

(self)

Source from the content-addressed store, hash-verified

1115
1116 @event._omit_standard_example
1117 def after_configured(self) -> None:
1118 """Called after a series of mappers have been configured.
1119
1120 The :meth:`.MapperEvents.after_configured` event is invoked
1121 each time the :func:`_orm.configure_mappers` function is
1122 invoked, after the function has completed its work.
1123 :func:`_orm.configure_mappers` is typically invoked
1124 automatically as mappings are first used, as well as each time
1125 new mappers have been made available and new mapper use is
1126 detected.
1127
1128 Similar events to this one include
1129 :meth:`.MapperEvents.before_configured`, which is invoked before a
1130 series of mappers are configured, as well as
1131 :meth:`.MapperEvents.before_mapper_configured` and
1132 :meth:`.MapperEvents.mapper_configured`, which are both invoked on a
1133 per-mapper basis.
1134
1135 This event can **only** be applied to the :class:`_orm.Mapper` class,
1136 and not to individual mappings or mapped classes::
1137
1138 from sqlalchemy.orm import Mapper
1139
1140
1141 @event.listens_for(Mapper, "after_configured")
1142 def go(): ...
1143
1144 Typically, this event is called once per application, but in practice
1145 may be called more than once, any time new mappers are to be affected
1146 by a :func:`_orm.configure_mappers` call. If new mappings are
1147 constructed after existing ones have already been used, this event will
1148 likely be called again.
1149
1150 .. seealso::
1151
1152 :meth:`.MapperEvents.before_mapper_configured`
1153
1154 :meth:`.MapperEvents.mapper_configured`
1155
1156 :meth:`.MapperEvents.before_configured`
1157
1158 :meth:`.RegistryEvents.before_configured`
1159
1160 :meth:`.RegistryEvents.after_configured`
1161
1162 """
1163
1164 def before_insert(
1165 self, mapper: Mapper[_O], connection: Connection, target: _O

Callers 1

_configure_registriesFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected