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

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Aug 26 08:54:50 CEST 2010


Author: ivan
Date: Thu Aug 26 08:54:49 2010
New Revision: 38019

URL: http://svn.erp5.org?rev=38019&view=rev
Log:
Introduce new listbox field ('style_columns') which is able to define columns for various listbox styles. Do not use any longer 'all_columns' (i.e. 'More Columns') which has a different purpose.

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=38019&r1=38018&r2=38019&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Form/ListBox.py [utf8] (original)
+++ erp5/trunk/products/ERP5Form/ListBox.py [utf8] Thu Aug 26 08:54:49 2010
@@ -199,6 +199,14 @@ class ListBoxWidget(Widget.Widget):
                                  required=0)
     property_names.append('all_columns')
 
+    style_columns = fields.ListTextAreaField('style_columns',
+                                 title="List Style Columns",
+                                 description=(
+        "An optional list of list style columns to display."),
+                                 default=[],
+                                 required=0)
+    property_names.append('style_columns')
+
     search_columns = fields.ListTextAreaField('search_columns',
                                  title="Searchable Columns",
                                  description=(
@@ -904,12 +912,12 @@ class ListBoxRenderer:
 
   getAllColumnList = lazyMethod(getAllColumnList)
 
-  def getRawAllColumnList(self):
-    """ Return the raw content of 'all_columns' listbox attribute 
+  def getStyleColumnList(self):
+    """Return the style columns columns.
     """
-    return self.field.get_value('all_columns')
+    return self.field.get_value('style_columns')
 
-  getRawAllColumnList = lazyMethod(getRawAllColumnList)
+  getStyleColumnList = lazyMethod(getStyleColumnList)
 
   def getStatColumnList(self):
     """Return the stat columns. Fall back to all the columns if empty.
@@ -1158,7 +1166,7 @@ class ListBoxRenderer:
       # no dynamically setting of columns happens , still we have different than default
       # listbox list style so try to get columns from 'More columns'
       list_style_prefix = "%s_" %listbox_display_style
-      for column in self.getRawAllColumnList():
+      for column in  self.getStyleColumnList():
         if column[1].startswith(list_style_prefix):
           column_list.append((column[0],column[1].replace(list_style_prefix, '',)))
     else:




More information about the Erp5-report mailing list