summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2013-07-18 23:17:33 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2013-07-18 23:17:33 -0400
commit9c6e45ff0157cdd4139cdeb68d38867e2baeaeb5 (patch)
tree352f50c8a5d8e66b62b40868dcb5110eb20ba70b /lib/sqlalchemy
parent0a54a4a4b0897bb8eaaf7a7857fb54924ccbd7ef (diff)
downloadsqlalchemy-9c6e45ff0157cdd4139cdeb68d38867e2baeaeb5.tar.gz
Fixed bug in ORM-level event registration where the "raw" or
"propagate" flags could potentially be mis-configured in some "unmapped base class" configurations. Also in 0.8.3. [ticket:2786]
Diffstat (limited to 'lib/sqlalchemy')
-rw-r--r--lib/sqlalchemy/orm/events.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/sqlalchemy/orm/events.py b/lib/sqlalchemy/orm/events.py
index 97019bb4e..14b3a770e 100644
--- a/lib/sqlalchemy/orm/events.py
+++ b/lib/sqlalchemy/orm/events.py
@@ -360,14 +360,17 @@ class _EventsHold(object):
def populate(cls, class_, subject):
for subclass in class_.__mro__:
if subclass in cls.all_holds:
- if subclass is class_:
- collection = cls.all_holds.pop(subclass)
- else:
- collection = cls.all_holds[subclass]
+ collection = cls.all_holds[subclass]
for ident, fn, raw, propagate in collection:
if propagate or subclass is class_:
+ # since we can't be sure in what order different classes
+ # in a hierarchy are triggered with populate(),
+ # we rely upon _EventsHold for all event
+ # assignment, instead of using the generic propagate
+ # flag.
subject.dispatch._listen(subject, ident,
- fn, raw, propagate)
+ fn, raw=raw,
+ propagate=False)
class _InstanceEventsHold(_EventsHold):