[Erp5-report] r19182 - /erp5/trunk/products/ERP5Form/ProxyField.py

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Feb 8 14:17:08 CET 2008


Author: vincent
Date: Fri Feb  8 14:17:08 2008
New Revision: 19182

URL: http://svn.erp5.org?rev=19182&view=rev
Log:
Avoid the need for backward compatibility code when possible. Also, avoid modifying persistent objects when possible.

Modified:
    erp5/trunk/products/ERP5Form/ProxyField.py

Modified: erp5/trunk/products/ERP5Form/ProxyField.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Form/ProxyField.py?rev=19182&r1=19181&r2=19182&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Form/ProxyField.py (original)
+++ erp5/trunk/products/ERP5Form/ProxyField.py Fri Feb  8 14:17:08 2008
@@ -149,6 +149,7 @@
 
   widget = ProxyWidgetInstance
   validator = ProxyValidatorInstance
+  delegated_list = tuple()
 
   # methods screen
   security.declareProtected('View management screens',
@@ -405,16 +406,7 @@
     Return true if we get the value from the proxied field.
     No, if we surcharged the value on the proxy field.
     """
-    # Update old proxied field
-    try:
-      if id in self.delegated_list:
-        return False
-      else:
-        return True
-    except AttributeError:
-      # Update old proxied field
-      self.delegated_list = []
-      return True
+    return id not in self.delegated_list
 
   security.declareProtected('Access contents information', 
                             'get_recursive_orig_value')




More information about the Erp5-report mailing list