This commit is contained in:
Mike Bayer
2005-09-16 07:27:33 +00:00
parent 8619a32c02
commit 538a41a8ad
2 changed files with 1 additions and 11 deletions
+1 -1
View File
@@ -688,7 +688,7 @@ class EagerLoader(PropertyLoader):
it to a list on the parent instance."""
if not self.uselist:
# TODO: check for multiple values on single-element child element ?
setattr(instance, self.key, self.mapper._instance(row))
setattr(instance, self.key, self.mapper._instance(row, imap))
return
elif isnew:
result_list = objectstore.uow().register_list_attribute(instance, self.key, data = [])
-10
View File
@@ -311,21 +311,15 @@ class SaveTest(AssertMixin):
objectstore.uow().register_new(u)
objectstore.uow().commit(u)
print "OK"
objectstore.uow().commit()
# assert the first one retreives the same from the identity map
nu = m.get(u.user_id)
self.assert_(u is nu)
print "STEP 1"
print repr(objectstore.identity_map)
# clear out the identity map, so next get forces a SELECT
objectstore.clear()
print "STEP 2"
print repr(objectstore.identity_map)
# check it again, identity should be different but ids the same
nu = m.get(u.user_id)
@@ -333,15 +327,11 @@ class SaveTest(AssertMixin):
# change first users name and save
u.user_name = 'modifiedname'
print "STEP 3"
print repr(objectstore.identity_map)
objectstore.uow().commit()
# select both
#objectstore.clear()
userlist = m.select(users.c.user_id.in_(u.user_id, u2.user_id), order_by=[users.c.user_name])
print repr(userlist)
# making a slight assumption here about the IN clause mechanics with regards to ordering
self.assert_(u.user_id == userlist[0].user_id and userlist[0].user_name == 'modifiedname')
self.assert_(u2.user_id == userlist[1].user_id and userlist[1].user_name == 'savetester2')