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

nobody at svn.erp5.org nobody at svn.erp5.org
Fri May 21 14:38:55 CEST 2010


Author: romain
Date: Fri May 21 14:38:50 2010
New Revision: 35526

URL: http://svn.erp5.org?rev=35526&view=rev
Log:
Add a new listbox parameter to define the list of display style (tabular, search, ...)

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=35526&r1=35525&r2=35526&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Form/ListBox.py [utf8] (original)
+++ erp5/trunk/products/ERP5Form/ListBox.py [utf8] Fri May 21 14:38:50 2010
@@ -389,6 +389,14 @@
                                  required=0)
     property_names.append('report_root_list')
 
+    display_style_list = fields.ListTextAreaField('display_style_list',
+                                title="Display style",
+                                description=(
+        "A list of styles which change the listbox rendering."),
+                                default=[],
+                                required=0)
+    property_names.append('display_style_list')
+
     list_action = fields.StringField('list_action',
                                  title='List Action',
                                  description=('The id of the object action'
@@ -915,6 +923,15 @@
     return [(str(c[0]), unicode(c[1], self.getEncoding())) for c in report_root_list]
 
   getReportRootList = lazyMethod(getReportRootList)
+
+  def getDisplayStyleList(self):
+    """Return the list of avaible display style. Make sure that the 
+    titles are in unicode"""
+    display_style_list = self.field.get_value('display_style_list')
+    return [(str(c[0]), unicode(c[1], self.getEncoding())) for c in \
+                                                      display_style_list]
+
+  getDisplayStyleList = lazyMethod(getDisplayStyleList)
 
   def getSearchColumnIdSet(self):
     """Return the set of the ids of the search columns. Fall back to the catalog schema, if not defined.




More information about the Erp5-report mailing list