diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-02-11 19:55:34 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-02-11 19:55:34 -0500 |
commit | 4a79bc578c67297c707a00d8fafaba533e2833d9 (patch) | |
tree | 808a412724a8137a95472ba974def1073ea1a301 /lib/sqlalchemy/orm/events.py | |
parent | 0050a8d3db04767b97e48f3aa71381b786481231 (diff) | |
download | sqlalchemy-4a79bc578c67297c707a00d8fafaba533e2833d9.tar.gz |
- Fixed bug where :class:`.AbstractConcreteBase` would fail to be
fully usable within declarative relationship configuration, as its
string classname would not be available in the registry of classnames
at mapper configuration time. The class now explicitly adds itself
to the class regsitry, and additionally both :class:`.AbstractConcreteBase`
as well as :class:`.ConcreteBase` set themselves up *before* mappers
are configured within the :func:`.configure_mappers` setup, using
the new :meth:`.MapperEvents.before_configured` event. [ticket:2950]
- Added new :meth:`.MapperEvents.before_configured` event which allows
an event at the start of :func:`.configure_mappers`, as well
as ``__declare_first__()`` hook within declarative to complement
``__declare_last__()``.
- modified how after_configured is invoked; we just make a dispatch()
not actually connected to any mapper. this makes it easier
to also invoke before_configured correctly.
- improved the ComparableEntity fixture to handle collections that are sets.
Diffstat (limited to 'lib/sqlalchemy/orm/events.py')
-rw-r--r-- | lib/sqlalchemy/orm/events.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/sqlalchemy/orm/events.py b/lib/sqlalchemy/orm/events.py index b2c356f24..52dcca232 100644 --- a/lib/sqlalchemy/orm/events.py +++ b/lib/sqlalchemy/orm/events.py @@ -583,6 +583,23 @@ class MapperEvents(event.Events): """ # TODO: need coverage for this event + def before_configured(self): + """Called before a series of mappers have been configured. + + This corresponds to the :func:`.orm.configure_mappers` call, which + note is usually called automatically as mappings are first + used. + + Theoretically this event is called once per + application, but is actually called any time new mappers + are to be affected by a :func:`.orm.configure_mappers` + call. If new mappings are constructed after existing ones have + already been used, this event can be called again. + + .. versionadded:: 0.9.3 + + """ + def after_configured(self): """Called after a series of mappers have been configured. |