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
This commit is contained in:
parent
dfe6423f77
commit
08b9c81b1c
2 changed files with 4 additions and 2 deletions
|
@ -411,6 +411,8 @@ class ChildRelationSetProperty(RelationSetProperty):
|
||||||
class ParentRelation(object):
|
class ParentRelation(object):
|
||||||
# TODO: provide special method for supplying relevance and order
|
# TODO: provide special method for supplying relevance and order
|
||||||
|
|
||||||
|
langInfo = None
|
||||||
|
|
||||||
def __init__(self, predicateName):
|
def __init__(self, predicateName):
|
||||||
self.predicateName = predicateName
|
self.predicateName = predicateName
|
||||||
|
|
||||||
|
@ -418,7 +420,7 @@ class ParentRelation(object):
|
||||||
if inst is None:
|
if inst is None:
|
||||||
return self
|
return self
|
||||||
for obj in ParentRelationSet(inst, self.predicateName):
|
for obj in ParentRelationSet(inst, self.predicateName):
|
||||||
return obj
|
return adapted(obj, langInfo=self.langInfo)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def __set__(self, inst, value):
|
def __set__(self, inst, value):
|
||||||
|
|
|
@ -80,7 +80,7 @@ class RelationFieldInstance(FieldInstance, BaseRelationFieldInstance):
|
||||||
|
|
||||||
def marshall(self, value):
|
def marshall(self, value):
|
||||||
if 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):
|
def display(self, value):
|
||||||
if value:
|
if value:
|
||||||
|
|
Loading…
Add table
Reference in a new issue