[Erp5-report] r22663 - in /erp5/trunk/products/ERP5Type: Accessor/RelatedValue.py Base.py

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Jul 25 16:14:45 CEST 2008


Author: vincent
Date: Fri Jul 25 16:14:44 2008
New Revision: 22663

URL: http://svn.erp5.org?rev=22663&view=rev
Log:
Do not hardcode CMFCategory.getRelatedValueList parameters in ERP5Type.
Handle argument name backward compatibility in only one place instead of 2.

Modified:
    erp5/trunk/products/ERP5Type/Accessor/RelatedValue.py
    erp5/trunk/products/ERP5Type/Base.py

Modified: erp5/trunk/products/ERP5Type/Accessor/RelatedValue.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Accessor/RelatedValue.py?rev=22663&r1=22662&r2=22663&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Accessor/RelatedValue.py (original)
+++ erp5/trunk/products/ERP5Type/Accessor/RelatedValue.py Fri Jul 25 16:14:44 2008
@@ -98,15 +98,7 @@
   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__)
 

Modified: erp5/trunk/products/ERP5Type/Base.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Base.py?rev=22663&r1=22662&r2=22663&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Base.py (original)
+++ erp5/trunk/products/ERP5Type/Base.py Fri Jul 25 16:14:44 2008
@@ -2072,17 +2072,11 @@
   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




More information about the Erp5-report mailing list