From: Mike Bayer Date: Tue, 18 Oct 2005 03:12:22 +0000 (+0000) Subject: (no commit message) X-Git-Tag: rel_0_1_0~507 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c92b7e875632b0607c994e576ea9c938b3578cbc;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git --- diff --git a/lib/sqlalchemy/objectstore.py b/lib/sqlalchemy/objectstore.py index 24bccf4323..638f910c4a 100644 --- a/lib/sqlalchemy/objectstore.py +++ b/lib/sqlalchemy/objectstore.py @@ -70,7 +70,7 @@ def has_key(key): class UOWSmartProperty(attributes.SmartProperty): def attribute_registry(self): - return uow().attributes + return global_attributes class UOWListElement(attributes.ListElement): def __init__(self, obj, key, data=None, deleteremoved=False): @@ -109,11 +109,10 @@ class UnitOfWork(object): self.is_begun = is_begun if parent is not None: self.identity_map = parent.identity_map - self.attributes = parent.attributes else: self.identity_map = {} - self.attributes = UOWAttributeManager() + self.attributes = global_attributes self.new = util.HashSet(ordered = True) self.dirty = util.HashSet() self.modified_lists = util.HashSet() @@ -582,5 +581,5 @@ def object_mapper(obj): return sqlalchemy.mapper.object_mapper(obj) uow = util.ScopedRegistry(lambda: UnitOfWork(), "thread") - +global_attributes = UOWAttributeManager()