]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- Fixed typo blocking some assoc proxy dict assignments, added test
authorJason Kirtland <jek@discorporate.us>
Sat, 16 Jun 2007 22:04:13 +0000 (22:04 +0000)
committerJason Kirtland <jek@discorporate.us>
Sat, 16 Jun 2007 22:04:13 +0000 (22:04 +0000)
lib/sqlalchemy/ext/associationproxy.py
test/ext/associationproxy.py

index 1b363c9acdfdf35fa894d75ab52bf31ca9db9690..cdb8147027147851e1fffc52ed055f9e2df0d206 100644 (file)
@@ -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:
index e095d285e41060bf757974082176923979d35dfb..4935f4b6eae384b1c39bcde25de17b280f798995 100644 (file)
@@ -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)