[Erp5-report] r26567 - /erp5/trunk/products/ERP5Form/ListBox.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Apr 21 17:16:34 CEST 2009


Author: vincent
Date: Tue Apr 21 17:16:32 2009
New Revision: 26567

URL: http://svn.erp5.org?rev=26567&view=rev
Log:
Extend filtering to more borderline cases:
- fields commonly found in listbox HTML renderer
- fields commonly found in xhtml style
- fields with empty string as a value, which can be empty listbox columns

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

Modified: erp5/trunk/products/ERP5Form/ListBox.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Form/ListBox.py?rev=26567&r1=26566&r2=26567&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Form/ListBox.py [utf8] (original)
+++ erp5/trunk/products/ERP5Form/ListBox.py [utf8] Tue Apr 21 17:16:32 2009
@@ -85,9 +85,22 @@
   """
   def __call__(self, *args, **kw):
     for parameter_id in ('selection', 'selection_name', 'select_columns',
-                         'reset', 'selection_index', 'list_selection_name',
-                         'list_start', 'list_lines'):
+      'reset', 'selection_index', 'list_selection_name', 'list_start',
+      'list_lines',
+      # Also strip common HTML field names
+      # XXX: I'm not sure if those values really belong to here
+      'md5_object_uid_list', 'cancel_url', 'listbox_list_selection_name',
+      'form_id', 'select_language', 'select_favorite', 'select_module',
+      'select_jump', 'select_action', 'Base_doSelect'):
       kw.pop(parameter_id, None)
+    # Strip all entries which have an empty string as value (ie, an empty
+    # field).
+    # XXX: I'm not sure if this filtering really belongs to here.
+    # It is probably needed at a more generic level (Forms ? Selection ?), or
+    # even a more specific one (limited to HTML ?)...
+    for key, value in kw.items():
+      if value == '':
+        kw.pop(key)
     return getattr(self.context, self.method_name)(*args, **kw)
 
 class ReportTree:




More information about the Erp5-report mailing list