Hi All, I was thinking about that del(self.field) that I threw in. Wouldn't that remove the object too and therefore the key reference?
Apparently not (in the test anyway):: >>> class TestField(Persistent): ... id = u'' ... def __init__(self, id): ... self.id = id >>> class TestCaseTwo(Persistent): ... def __init__(self): ... self.field = TestField(id=u'test case two') ... def initfield(self): ... self.fieldkey = KeyReferenceToPersistent(self.field) ... del(self.field) >>> t = TestCaseTwo() >>> tc = root['t'] = t >>> transaction.commit() >>> tc.initfield() >>> print tc.field Traceback (most recent call last): ... AttributeError:... >>> print tc.fieldkey().id test case two >>> transaction.commit() >>> print tc.fieldkey().id # I thought this would fail test case two Best regards, Darryl _______________________________________________ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users