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: