Commit 44e6a06c authored by Yusei Tahara's avatar Yusei Tahara

2010-06-08 yusei

* Add CategoryTool_getPreferredPredicateCategoryParentUidItemList for optimized predicate category search.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@36093 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 74f1e358
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>#\n
# This script is used by portal_catalog/erp5_mysql_innodb/z_catalog_predicate_category_list\n
#\n
enabled_base_category_list = document.getBaseCategoryList()\n
\n
preferred_predicate_category_list = context.portal_preferences.getPreferredPredicateCategoryList()\n
\n
category_parent_uid_item_list = context.getCategoryParentUidList(membership_criterion_category_list)\n
\n
if not preferred_predicate_category_list:\n
return category_parent_uid_item_list\n
\n
# category_parent_uid_item_list structure is (category_uid, base_category_uid, category_strict_membership)\n
category_parent_uid_item_dict = dict([(item[1], item) for item in category_parent_uid_item_list])\n
\n
for base_category_id in preferred_predicate_category_list:\n
base_category = getattr(context, base_category_id, None)\n
if base_category is None:\n
pass\n
base_category_uid = base_category.getUid()\n
\n
if not base_category_uid in category_parent_uid_item_dict and base_category_id in enabled_base_category_list:\n
# Add an empty record only if document does not have the category value and the category is enabled on the document.\n
category_parent_uid_item_dict[base_category_uid] = [0, base_category_uid, 1]\n
\n
return category_parent_uid_item_dict.values()\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>membership_criterion_category_list, document</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>2</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>membership_criterion_category_list</string>
<string>document</string>
<string>_getattr_</string>
<string>enabled_base_category_list</string>
<string>context</string>
<string>preferred_predicate_category_list</string>
<string>category_parent_uid_item_list</string>
<string>dict</string>
<string>append</string>
<string>$append0</string>
<string>_getiter_</string>
<string>item</string>
<string>_getitem_</string>
<string>category_parent_uid_item_dict</string>
<string>base_category_id</string>
<string>getattr</string>
<string>None</string>
<string>base_category</string>
<string>base_category_uid</string>
<string>_write_</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>CategoryTool_getPreferredPredicateCategoryParentUidItemList</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
2010-06-08 yusei
* Add CategoryTool_getPreferredPredicateCategoryParentUidItemList for optimized predicate category search.
2010-06-04 yo
* Do not enable reindexing by default. Who has approved such a change? It is up to the system administrator to decide when the catalog can be cleared.
......
1600
\ No newline at end of file
1601
\ 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