From 37f9c84b1002ff4ee3f28986f138b8ac0be1b8e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com> Date: Fri, 30 Dec 2005 19:57:28 +0000 Subject: [PATCH] add missing method _getRelatedPropertyList, make sure _setValue accept None to unset a relation. git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4971 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5Type/Base.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/product/ERP5Type/Base.py b/product/ERP5Type/Base.py index 83788da2fc..cebb3b58e4 100755 --- a/product/ERP5Type/Base.py +++ b/product/ERP5Type/Base.py @@ -1212,7 +1212,9 @@ class Base( CopyContainer, PortalContent, ActiveObject, ERP5PropertyManager ): # categories security.declareProtected( Permissions.ModifyPortalContent, '_setValue' ) def _setValue(self, id, target, spec=(), filter=None, portal_type=()): - if type(target) is type('a'): + if target is None : + path = target + elif type(target) is type('a'): # We have been provided a string path = target elif type(target) is type(('a','b')) or type(target) is type(['a','b']): @@ -1336,6 +1338,20 @@ class Base( CopyContainer, PortalContent, ActiveObject, ERP5PropertyManager ): security.declareProtected( Permissions.View, 'getRelatedValueList' ) getRelatedValueList = _getRelatedValueList + security.declareProtected( Permissions.AccessContentsInformation, + '_getRelatedPropertyList' ) + def _getRelatedPropertyList(self, id, property_name, spec=(), filter=None, + portal_type=(), strict_membership=0): + return self._getCategoryTool().getRelatedPropertyList(self, id, + property_name=property_name, + spec=spec, filter=filter, + portal_type=portal_type, + strict_membership=strict_membership) + + security.declareProtected( Permissions.AccessContentsInformation, + 'getRelatedPropertyList' ) + getRelatedPropertyList = _getRelatedPropertyList + security.declareProtected( Permissions.View, 'getValueUids' ) def getValueUids(self, id, spec=(), filter=None, portal_type=()): uid_list = [] -- 2.30.9