Commit af4b4201 authored by Vincent Pelletier's avatar Vincent Pelletier

Do not hardcode CMFCategory.getRelatedValueList parameters in ERP5Type.

Handle argument name backward compatibility in only one place instead of 2.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@22663 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 884c1954
......@@ -98,15 +98,7 @@ class ListGetter(BaseGetter):
def __call__(self, instance, *args, **kw):
if self._warning:
LOG("ERP5Type", WARNING, "Deprecated Getter Id: %s" % self._id)
return instance._getRelatedValueList(
self._key,
spec=kw.get('spec',()),
filter=kw.get('filter', None),
portal_type=kw.get('portal_type',()),
strict_membership=kw.get('strict_membership',
# 'strict' is deprecated
kw.get('strict', None)),
checked_permission=kw.get('checked_permission', None))
return instance._getRelatedValueList(self._key, *args, **kw)
psyco.bind(__call__)
......
......@@ -2072,17 +2072,11 @@ class Base( CopyContainer,
security.declareProtected(Permissions.View, 'getDefaultRelatedValue')
getDefaultRelatedValue = _getDefaultRelatedValue
def _getRelatedValueList(self, id, spec=(), filter=None, portal_type=(),
strict_membership=0, strict="deprecated",
checked_permission=None):
def _getRelatedValueList(self, *args, **kw):
# backward compatibility to keep strict keyword working
if strict != "deprecated" :
strict_membership = strict
return self._getCategoryTool().getRelatedValueList(
self, id,
spec=spec, filter=filter, portal_type=portal_type,
strict_membership=strict_membership,
checked_permission=checked_permission)
if 'strict' in kw:
kw['strict_membership'] = kw.pop('strict')
return self._getCategoryTool().getRelatedValueList(self, *args, **kw)
security.declareProtected(Permissions.View, 'getRelatedValueList')
getRelatedValueList = _getRelatedValueList
......
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