From: Jason Kirtland Date: Sat, 16 Jun 2007 22:04:13 +0000 (+0000) Subject: - Fixed typo blocking some assoc proxy dict assignments, added test X-Git-Tag: rel_0_3_9~81 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6cd584d3031bbb810d2c7f400ae38b941088ded9;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - Fixed typo blocking some assoc proxy dict assignments, added test --- 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)