Commit 1b20fd39 authored by Nicolas Delaby's avatar Nicolas Delaby

Add _getDefaultRelatedProperty Accessor

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@12028 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 17f24824
......@@ -1532,6 +1532,25 @@ class Base( CopyContainer,
security.declareProtected( Permissions.View, 'getRelatedValueList' )
getRelatedValueList = _getRelatedValueList
security.declareProtected( Permissions.AccessContentsInformation,
'_getDefaultRelatedProperty' )
def _getDefaultRelatedProperty(self, id, property_name, spec=(), filter=None,
portal_type=(), strict_membership=0):
property_list = self._getCategoryTool().getRelatedPropertyList(self, id,
property_name=property_name,
spec=spec, filter=filter,
portal_type=portal_type,
strict_membership=strict_membership)
try:
return property_list[0]
except IndexError:
return None
security.declareProtected( Permissions.AccessContentsInformation,
'getDefaultRelatedProperty' )
getDefaultRelatedProperty = _getDefaultRelatedProperty
security.declareProtected( Permissions.AccessContentsInformation,
'_getRelatedPropertyList' )
def _getRelatedPropertyList(self, id, property_name, spec=(), filter=None,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment