[Erp5-report] r41173 nicolas - /erp5/trunk/products/Formulator/Widget.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Mon Dec 6 18:11:47 CET 2010
Author: nicolas
Date: Mon Dec 6 18:11:46 2010
New Revision: 41173
URL: http://svn.erp5.org?rev=41173&view=rev
Log:
Avoid useless dictionary computation in render_dict
Modified:
erp5/trunk/products/Formulator/Widget.py
Modified: erp5/trunk/products/Formulator/Widget.py
URL: http://svn.erp5.org/erp5/trunk/products/Formulator/Widget.py?rev=41173&r1=41172&r2=41173&view=diff
==============================================================================
--- erp5/trunk/products/Formulator/Widget.py [utf8] (original)
+++ erp5/trunk/products/Formulator/Widget.py [utf8] Mon Dec 6 18:11:46 2010
@@ -1331,6 +1331,8 @@ class DateTimeWidget(Widget):
format of provided value.
query : Passthrough of given value.
"""
+ if not value:
+ return None
format_dict = self.format_to_sql_format_dict
input_order = format_dict.get(self.getInputOrder(field),
self.sql_format_default)
@@ -1807,6 +1809,8 @@ class FloatWidget(TextWidget):
format of provided value.
query : Passthrough of given value.
"""
+ if not value:
+ return None
precision = field.get_value('precision')
format = '0'
if precision:
More information about the Erp5-report
mailing list