From 08b9c81b1c0b432817a98916977cc8781f6e24ce Mon Sep 17 00:00:00 2001 From: helmutm Date: Thu, 29 Jan 2009 07:45:51 +0000 Subject: [PATCH] always return adapted object on relation property (as with relation set property) git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@3188 fd906abe-77d9-0310-91a1-e0d9ade77398 --- common.py | 4 +++- schema/field.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/common.py b/common.py index 8ce0bfa..fa9c6ec 100644 --- a/common.py +++ b/common.py @@ -411,6 +411,8 @@ class ChildRelationSetProperty(RelationSetProperty): class ParentRelation(object): # TODO: provide special method for supplying relevance and order + langInfo = None + def __init__(self, predicateName): self.predicateName = predicateName @@ -418,7 +420,7 @@ class ParentRelation(object): if inst is None: return self for obj in ParentRelationSet(inst, self.predicateName): - return obj + return adapted(obj, langInfo=self.langInfo) return None def __set__(self, inst, value): diff --git a/schema/field.py b/schema/field.py index 03f46ef..b24b78e 100644 --- a/schema/field.py +++ b/schema/field.py @@ -80,7 +80,7 @@ class RelationFieldInstance(FieldInstance, BaseRelationFieldInstance): def marshall(self, value): if value: - return dict(title=value.title, uid=util.getUidForObject(value)) + return dict(title=value.title, uid=util.getUidForObject(value.context)) def display(self, value): if value: