[Erp5-report] r44609 vincent - /erp5/trunk/products/ERP5Type/Base.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Fri Mar 25 11:19:52 CET 2011
Author: vincent
Date: Fri Mar 25 11:19:52 2011
New Revision: 44609
URL: http://svn.erp5.org?rev=44609&view=rev
Log:
Marginal optimisations while reading code.
Modified:
erp5/trunk/products/ERP5Type/Base.py
Modified: erp5/trunk/products/ERP5Type/Base.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Base.py?rev=44609&r1=44608&r2=44609&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Base.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/Base.py [utf8] Fri Mar 25 11:19:52 2011
@@ -1361,9 +1361,9 @@ class Base( CopyContainer,
keep_existing -- if set to 1 or True, only those properties for which
hasProperty is False will be updated.
"""
- key_list = kw.keys()
- if len(key_list) == 0:
+ if not kw:
return
+ key_list = kw.keys()
modified_property_dict = self._v_modified_property_dict = {}
modified_object_dict = {}
@@ -1390,14 +1390,17 @@ class Base( CopyContainer,
for key in key_list:
# We only change if the value is different
# This may be very long...
- old_value = None
- if not force_update:
+ if force_update:
+ update = True
+ old_value = None
+ else:
try:
old_value = getProperty(key, evaluate=0)
except TypeError:
old_value = getProperty(key)
+ update = old_value != kw[key]
- if old_value != kw[key] or force_update:
+ if update:
# We keep in a thread var the previous values
# this can be useful for interaction workflow to implement lookups
# XXX If iteraction workflow script is triggered by edit and calls
More information about the Erp5-report
mailing list