[Erp5-report] r27630 - /erp5/trunk/products/ERP5/Document/BusinessPath.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Wed Jun 17 11:48:42 CEST 2009
Author: luke
Date: Wed Jun 17 11:48:40 2009
New Revision: 27630
URL: http://svn.erp5.org?rev=27630&view=rev
Log:
- simplification, naming convention (thanks jm)
Modified:
erp5/trunk/products/ERP5/Document/BusinessPath.py
Modified: erp5/trunk/products/ERP5/Document/BusinessPath.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/BusinessPath.py?rev=27630&r1=27629&r2=27630&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/BusinessPath.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/BusinessPath.py [utf8] Wed Jun 17 11:48:40 2009
@@ -145,16 +145,13 @@
TBD - look at CategoryTool._buildFilter for inspiration
"""
filtered_category_list = []
- for cat in category_list:
+ for local_category in category_list:
# basic filtering, dirty way:
# - remove categories, which are not defined in category parameter
# - support base parameter
- base_cat, base_value = cat.split('/')[0] , '/'.join(cat.split('/')[1:])
- if base_cat == category:
- value = base_value
- if base == 1:
- value = '/'.join([base_cat, value])
- filtered_category_list.append(value)
+ base_category, base_value = local_category.split('/', 1)
+ if base_category == category:
+ filtered_category_list.append(base == 1 and local_category or base_value)
return filtered_category_list
# Dynamic context based categories
More information about the Erp5-report
mailing list