[Erp5-report] r38011 kazuhiko - /erp5/trunk/products/ERP5Type/Base.py

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Aug 25 11:40:37 CEST 2010


Author: kazuhiko
Date: Wed Aug 25 11:40:35 2010
New Revision: 38011

URL: http://svn.erp5.org?rev=38011&view=rev
Log:
modify getSearchableText():
* support list properties.
* cast to str explicitly.

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=38011&r1=38010&r2=38011&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Base.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/Base.py [utf8] Wed Aug 25 11:40:35 2010
@@ -3221,8 +3221,11 @@ class Base( CopyContainer,
         if method is not None:
           method_value = method()
           if method_value is not None:
-            searchable_text_list.append(method_value)
-      searchable_text = ' '.join(searchable_text_list)
+            if isinstance(method_value, (list, tuple)):
+              searchable_text_list.extend(method_value)
+            else:
+              searchable_text_list.append(method_value)
+      searchable_text = ' '.join([str(x) for x in searchable_text_list])
       return searchable_text
 
   # Compatibility with CMF Catalog / CPS sites




More information about the Erp5-report mailing list