From e3ce0a7933be002a076064519ca70d4c94da1866 Mon Sep 17 00:00:00 2001 From: Griatch Date: Fri, 27 Apr 2012 00:03:31 +0200 Subject: [PATCH] Some fixes to the caching, particularly in set_attribute. --- src/commands/command.py | 1 + src/typeclasses/models.py | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/commands/command.py b/src/commands/command.py index 90dcc89763..895e2e8d40 100644 --- a/src/commands/command.py +++ b/src/commands/command.py @@ -127,6 +127,7 @@ class Command(object): def __init__(self): + "the lockhandler works the same as for objects." self.lockhandler = LockHandler(self) def __str__(self): diff --git a/src/typeclasses/models.py b/src/typeclasses/models.py index d575b0fe27..c9919328e6 100644 --- a/src/typeclasses/models.py +++ b/src/typeclasses/models.py @@ -1247,9 +1247,9 @@ class TypedObject(SharedMemoryModel): if attrib_obj: # use old attribute attrib_obj = attrib_obj[0] - else: - # no match; create new attribute - attrib_obj = attrclass(db_key=attribute_name, db_obj=self) + else: + # no match; create new attribute + attrib_obj = attrclass(db_key=attribute_name, db_obj=self) # re-set an old attribute value attrib_obj.value = new_value _GA(self,"_attribute_cache")[attribute_name] = attrib_obj