From 2959f5d844c7029a065125ba25d550706e5aad86 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sun, 26 Feb 2006 21:39:14 +0000 Subject: [PATCH] place _instance_key on object only when objectstore finally register_clean's on it, to make room for more aggressive "identity map" assertion when modifying objects incoming from a result set --- lib/sqlalchemy/mapping/mapper.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/sqlalchemy/mapping/mapper.py b/lib/sqlalchemy/mapping/mapper.py index 33bec863e8..4541c899a9 100644 --- a/lib/sqlalchemy/mapping/mapper.py +++ b/lib/sqlalchemy/mapping/mapper.py @@ -724,8 +724,6 @@ class Mapper(object): instance = self.extension.create_instance(self, row, imap, self.class_) if instance is None: instance = self.class_(_mapper_nohistory=True) - instance._instance_key = identitykey - imap[identitykey] = instance isnew = True else: @@ -742,7 +740,7 @@ class Mapper(object): if self.extension.append_result(self, row, imap, result, instance, isnew, populate_existing=populate_existing): if result is not None: result.append_nohistory(instance) - + return instance class MapperProperty(object): -- 2.47.2