]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
- [bug] Lazy loads emitted within flush events
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 19 Aug 2012 16:35:39 +0000 (12:35 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 19 Aug 2012 16:35:39 +0000 (12:35 -0400)
commit3087b8ddef6e903aff95e14742888cf2804a9206
tree37128086224656393b4f888b673b391df3532824
parentb47c185fc4b09f0ee8f8445fb1b7ea41beafa0d7
- [bug] Lazy loads emitted within flush events
such as before_flush(), before_update(),
etc. will now function as they would
within non-event code, regarding consideration
of the PK/FK values used in the lazy-emitted
query.   Previously,
special flags would be established that
would cause lazy loads to load related items
based on the "previous" value of the
parent PK/FK values specifically when called
upon within a flush; the signal to load
in this way is now localized to where the
unit of work actually needs to load that
way.  Note that the UOW does
sometimes load these collections before
the before_update() event is called,
so the usage of "passive_updates" or not
can affect whether or not a collection will
represent the "old" or "new" data, when
accessed within a flush event, based
on when the lazy load was emitted.
The change is backwards incompatible in
the exceedingly small chance that
user event code depended on the old
behavior. [ticket:2350]
CHANGES
lib/sqlalchemy/orm/attributes.py
lib/sqlalchemy/orm/strategies.py
lib/sqlalchemy/orm/unitofwork.py
test/orm/test_unitofworkv2.py