Commit fd00128b authored by Christophe Dumez's avatar Christophe Dumez

- Code optimization in OOo important (split relativeUrl instead of full path of a category)

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@9114 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ac15ab56
......@@ -90,13 +90,13 @@ for category_name in category_dict.keys():\n
category_object = context.getPortalObject().portal_categories[category_name]\n
result_list = context.portal_catalog(portal_type=\'Category\', reference=str(subcat_code), relative_url=category_name+\'%\')\n
if len(result_list) != 0:\n
result_cat_fullpath = \'/\'.join(result_list[0].getPath().split(\'/\')[4:])\n
result_cat_fullpath = \'/\'.join(result_list[0].getRelativeUrl().split(\'/\')[1:])\n
result_dict[category_name]=result_cat_fullpath\n
else:\n
# XXX: this request does a LIKE "%xxxx%", We should find a way to remove the %%\n
result_list = context.portal_catalog(portal_type=\'Category\', title=str(subcat_code), relative_url=category_name+\'%\')\n
if len(result_list) != 0:\n
result_cat_fullpath = \'/\'.join(result_list[0].getPath().split(\'/\')[4:])\n
result_cat_fullpath = \'/\'.join(result_list[0].getRelativeUrl().split(\'/\')[1:])\n
result_dict[category_name]=result_cat_fullpath\n
#result_cat = getMatchingCategoryUsingCodification(root_category=category_object, codification=subcat_code)\n
#if result_cat is not None:\n
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment