Commit fe15de55 authored by Romain Courteaud's avatar Romain Courteaud

Add query parameter to _getRelated[...] methods.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13436 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6f44d763
......@@ -1575,60 +1575,72 @@ class Base( CopyContainer,
security.declareProtected( Permissions.View, '_getDefaultRelatedValue' )
def _getDefaultRelatedValue(self, id, spec=(), filter=None, portal_type=(),
strict_membership=0, strict="deprecated"):
strict_membership=0, strict="deprecated",
query=None):
# backward compatibility to keep strict keyword working
if strict != "deprecated" : strict_membership = strict
value_list =self._getRelatedValueList(id, spec=spec, filter=filter,
if strict != "deprecated" :
strict_membership = strict
value_list =self._getRelatedValueList(
id, spec=spec, filter=filter,
portal_type=portal_type,
strict_membership=strict_membership)
strict_membership=strict_membership,
query=query)
try:
return value_list[0]
except IndexError:
return None
security.declareProtected( Permissions.View, 'getDefaultRelatedValue' )
security.declareProtected(Permissions.View, 'getDefaultRelatedValue')
getDefaultRelatedValue = _getDefaultRelatedValue
security.declareProtected( Permissions.View, '_getRelatedValueList' )
def _getRelatedValueList(self, id, spec=(), filter=None, portal_type=(),
strict_membership=0, strict="deprecated"):
strict_membership=0, strict="deprecated",
query=None):
# backward compatibility to keep strict keyword working
if strict != "deprecated" : strict_membership = strict
return self._getCategoryTool().getRelatedValueList(self, id,
if strict != "deprecated" :
strict_membership = strict
return self._getCategoryTool().getRelatedValueList(
self, id,
spec=spec, filter=filter, portal_type=portal_type,
strict_membership=strict_membership)
strict_membership=strict_membership,
query=query)
security.declareProtected( Permissions.View, 'getRelatedValueList' )
security.declareProtected(Permissions.View, 'getRelatedValueList')
getRelatedValueList = _getRelatedValueList
security.declareProtected( Permissions.AccessContentsInformation,
'_getDefaultRelatedProperty' )
security.declareProtected(Permissions.AccessContentsInformation,
'_getDefaultRelatedProperty')
def _getDefaultRelatedProperty(self, id, property_name, spec=(), filter=None,
portal_type=(), strict_membership=0):
portal_type=(), strict_membership=0,
query=None):
property_list = self._getCategoryTool().getRelatedPropertyList(self, id,
property_name=property_name,
spec=spec, filter=filter,
portal_type=portal_type,
strict_membership=strict_membership)
strict_membership=strict_membership,
query=query)
try:
return property_list[0]
except IndexError:
return None
security.declareProtected( Permissions.AccessContentsInformation,
'getDefaultRelatedProperty' )
security.declareProtected(Permissions.AccessContentsInformation,
'getDefaultRelatedProperty')
getDefaultRelatedProperty = _getDefaultRelatedProperty
security.declareProtected( Permissions.AccessContentsInformation,
'_getRelatedPropertyList' )
security.declareProtected(Permissions.AccessContentsInformation,
'_getRelatedPropertyList')
def _getRelatedPropertyList(self, id, property_name, spec=(), filter=None,
portal_type=(), strict_membership=0):
portal_type=(), strict_membership=0,
query=None):
return self._getCategoryTool().getRelatedPropertyList(self, id,
property_name=property_name,
spec=spec, filter=filter,
portal_type=portal_type,
strict_membership=strict_membership)
strict_membership=strict_membership,
query=query)
security.declareProtected( Permissions.AccessContentsInformation,
'getRelatedPropertyList' )
......
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