From 6cd584d3031bbb810d2c7f400ae38b941088ded9 Mon Sep 17 00:00:00 2001 From: Jason Kirtland Date: Sat, 16 Jun 2007 22:04:13 +0000 Subject: [PATCH] - Fixed typo blocking some assoc proxy dict assignments, added test --- lib/sqlalchemy/ext/associationproxy.py | 2 +- test/ext/associationproxy.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/sqlalchemy/ext/associationproxy.py b/lib/sqlalchemy/ext/associationproxy.py index 1b363c9acd..cdb8147027 100644 --- a/lib/sqlalchemy/ext/associationproxy.py +++ b/lib/sqlalchemy/ext/associationproxy.py @@ -189,7 +189,7 @@ class AssociationProxy(object): return _AssociationList(lazy_collection, creator, getter, setter) elif self.collection_class is dict: kv_setter = lambda o, k, v: setattr(o, value_attr, v) - return _AssociationDict(lazy_collection, creator, getter, setter) + return _AssociationDict(lazy_collection, creator, getter, kv_setter) elif self.collection_class is util.Set: return _AssociationSet(lazy_collection, creator, getter, setter) else: diff --git a/test/ext/associationproxy.py b/test/ext/associationproxy.py index e095d285e4..4935f4b6ea 100644 --- a/test/ext/associationproxy.py +++ b/test/ext/associationproxy.py @@ -218,6 +218,9 @@ class CustomDictTest(DictTest): self.assert_(len(p1._children) == 3) self.assert_(len(p1.children) == 3) + p1.children['d'] = 'new d' + assert p1.children['d'] == 'new d' + p1._children = {} self.assert_(len(p1.children) == 0) -- 2.47.2