Commit c48d1f9e authored by Jérome Perrin's avatar Jérome Perrin

use fallback categories instead of hardcoding destination_region, source_region

etc.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13724 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6aefb581
...@@ -78,13 +78,19 @@ for item in multimembership_base_list :\n ...@@ -78,13 +78,19 @@ for item in multimembership_base_list :\n
\n \n
category_list = []\n category_list = []\n
\n \n
ctool = context.portal_categories\n
for item in mixed_list:\n for item in mixed_list:\n
if item in (\'destination_region\', \'source_region\'):\n base_category = ctool[item]\n
category = \'region\' # This must be made more generic\n item_list = base_category.getCategoryChildCompactLogicalPathItemList(base=1)\n
category_list += [(x[0], \'%s/%s\' % (item, x[1])) for x in \n if item_list == [[\'\', \'\']]:\n
context.portal_categories[category].getCategoryChildCompactLogicalPathItemList(base=1)]\n for fallback_category in base_category.getFallbackBaseCategoryList():\n
else:\n fallback_category = ctool.restrictedTraverse(fallback_category, None)\n
category_list += context.portal_categories[item].getCategoryChildCompactLogicalPathItemList(base=1)\n if fallback_category:\n
item_list = [(\'%s/%s\' % (item, x[0]), \'%s/%s\' % (item, x[1])) for x in\n
fallback_category.getCategoryChildCompactLogicalPathItemList(base=1)]\n
break\n
\n
category_list.extend(item_list)\n
\n \n
return category_list\n return category_list\n
</string> </value> </string> </value>
...@@ -137,10 +143,14 @@ return category_list\n ...@@ -137,10 +143,14 @@ return category_list\n
<string>_getiter_</string> <string>_getiter_</string>
<string>item</string> <string>item</string>
<string>category_list</string> <string>category_list</string>
<string>category</string> <string>ctool</string>
<string>_getitem_</string>
<string>base_category</string>
<string>item_list</string>
<string>fallback_category</string>
<string>None</string>
<string>append</string> <string>append</string>
<string>$append0</string> <string>$append0</string>
<string>_getitem_</string>
<string>x</string> <string>x</string>
</tuple> </tuple>
</value> </value>
......
285 282
\ No newline at end of file \ No newline at end of file
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