diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-08-19 12:35:39 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-08-19 12:35:39 -0400 |
commit | 3087b8ddef6e903aff95e14742888cf2804a9206 (patch) | |
tree | 37128086224656393b4f888b673b391df3532824 /lib/sqlalchemy/orm/attributes.py | |
parent | b47c185fc4b09f0ee8f8445fb1b7ea41beafa0d7 (diff) | |
download | sqlalchemy-3087b8ddef6e903aff95e14742888cf2804a9206.tar.gz |
- [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]
Diffstat (limited to 'lib/sqlalchemy/orm/attributes.py')
-rw-r--r-- | lib/sqlalchemy/orm/attributes.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/sqlalchemy/orm/attributes.py b/lib/sqlalchemy/orm/attributes.py index 08e536f71..9b0b35e28 100644 --- a/lib/sqlalchemy/orm/attributes.py +++ b/lib/sqlalchemy/orm/attributes.py @@ -84,6 +84,11 @@ NON_PERSISTENT_OK = util.symbol("NON_PERSISTENT_OK", canonical=16 ) +LOAD_AGAINST_COMMITTED = util.symbol("LOAD_AGAINST_COMMITTED", +"""callables should use committed values as primary/foreign keys during a load""", +canonical=32 +) + # pre-packaged sets of flags used as inputs PASSIVE_OFF = util.symbol("PASSIVE_OFF", "Callables can be emitted in all cases.", |