summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2012-12-22 18:40:06 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2012-12-22 18:40:06 -0500
commit5b23a6808041ff90e2097e2cb37188d4845828f4 (patch)
treee5732791a83f505185fd3c7a622aae01cb083ea7 /lib
parentefbbe88705eb19d68b587aae6dfb60cfe4356edb (diff)
downloadsqlalchemy-5b23a6808041ff90e2097e2cb37188d4845828f4.tar.gz
- add tests to ensure SELECT of dynamic collection not emitted
on regular append/remove history - fix the real cause of the original #2637 issue, backrefs call upon the "pop()" method now which wasn't implemented for Dynamic
Diffstat (limited to 'lib')
-rw-r--r--lib/sqlalchemy/orm/attributes.py1
-rw-r--r--lib/sqlalchemy/orm/dynamic.py3
2 files changed, 3 insertions, 1 deletions
diff --git a/lib/sqlalchemy/orm/attributes.py b/lib/sqlalchemy/orm/attributes.py
index 060eaa6e5..d2f20e94d 100644
--- a/lib/sqlalchemy/orm/attributes.py
+++ b/lib/sqlalchemy/orm/attributes.py
@@ -1030,7 +1030,6 @@ def backref_listeners(attribute, key, uselist):
def emit_backref_from_scalar_set_event(state, child, oldchild, initiator):
if oldchild is child:
return child
-
if oldchild is not None and oldchild is not PASSIVE_NO_RESULT:
# With lazy=None, there's no guarantee that the full collection is
# present when updating via a backref.
diff --git a/lib/sqlalchemy/orm/dynamic.py b/lib/sqlalchemy/orm/dynamic.py
index c193f0e2a..3ab454a43 100644
--- a/lib/sqlalchemy/orm/dynamic.py
+++ b/lib/sqlalchemy/orm/dynamic.py
@@ -195,6 +195,9 @@ class DynamicAttributeImpl(attributes.AttributeImpl):
if initiator is not self:
self.fire_remove_event(state, dict_, value, initiator)
+ def pop(self, state, dict_, value, initiator,
+ passive=attributes.PASSIVE_OFF):
+ self.remove(state, dict_, value, initiator, passive=passive)
class AppenderMixin(object):