[Erp5-report] r28761 - in /erp5/trunk/bt5/erp5_commerce: SkinTemplateItem/portal_skins/erp5...
nobody at svn.erp5.org
nobody at svn.erp5.org
Wed Sep 2 23:11:25 CEST 2009
Author: lucas
Date: Wed Sep 2 23:11:24 2009
New Revision: 28761
URL: http://svn.erp5.org?rev=28761&view=rev
Log:
improved the code
Modified:
erp5/trunk/bt5/erp5_commerce/SkinTemplateItem/portal_skins/erp5_commerce_widget_library/WebSite_getProductList.xml
erp5/trunk/bt5/erp5_commerce/bt/revision
Modified: erp5/trunk/bt5/erp5_commerce/SkinTemplateItem/portal_skins/erp5_commerce_widget_library/WebSite_getProductList.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_commerce/SkinTemplateItem/portal_skins/erp5_commerce_widget_library/WebSite_getProductList.xml?rev=28761&r1=28760&r2=28761&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_commerce/SkinTemplateItem/portal_skins/erp5_commerce_widget_library/WebSite_getProductList.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_commerce/SkinTemplateItem/portal_skins/erp5_commerce_widget_library/WebSite_getProductList.xml [utf8] Wed Sep 2 23:11:24 2009
@@ -66,16 +66,10 @@
kw[\'limit\'] = limit\n
\n
# Getting all the products from all the visible Web Section.\n
-web_section_list = web_site.WebSite_getMainSectionList()\n
-for web_section in web_section_list:\n
- product_result_list = web_section.WebSection_getDocumentValueListBase(all_versions=1, all_languages=1, **kw)\n
- for product in product_result_list:\n
- if product.getObject() not in product_list:\n
- product_list.append(product.getObject())\n
+for web_section in web_site.WebSite_getMainSectionList():\n
+ product_list.extend([x.getObject() for x in web_section.getDocumentValueList(all_versions=1, all_languages=1, **kw) if x.getObject() not in product_list])\n
\n
-if len(product_list) <= limit:\n
- product_list = [x for x in product_list if x.getPortalType() == \'Product\']\n
-else:\n
+if len(product_list) > limit:\n
random_index_list = []\n
while len(random_index_list) < limit:\n
random_number = randrange(0, len(product_list))\n
@@ -147,16 +141,13 @@
<string>web_site</string>
<string>product_list</string>
<string>_write_</string>
- <string>web_section_list</string>
<string>_getiter_</string>
<string>web_section</string>
- <string>_apply_</string>
- <string>product_result_list</string>
- <string>product</string>
- <string>len</string>
<string>append</string>
<string>$append0</string>
+ <string>_apply_</string>
<string>x</string>
+ <string>len</string>
<string>random_index_list</string>
<string>random_number</string>
<string>_getitem_</string>
Modified: erp5/trunk/bt5/erp5_commerce/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_commerce/bt/revision?rev=28761&r1=28760&r2=28761&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_commerce/bt/revision [utf8] (original)
+++ erp5/trunk/bt5/erp5_commerce/bt/revision [utf8] Wed Sep 2 23:11:24 2009
@@ -1,1 +1,1 @@
-187
+188
More information about the Erp5-report
mailing list