From: Mike Bayer Date: Sun, 26 Feb 2006 21:39:14 +0000 (+0000) Subject: place _instance_key on object only when objectstore finally register_clean's on it... X-Git-Tag: rel_0_1_3~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2959f5d844c7029a065125ba25d550706e5aad86;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git 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 --- 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):