Commit 92be5dee authored by Ivan Tyagov's avatar Ivan Tyagov

Cosmetic changes.

Add script to determine owner's title.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@44381 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d0ad30e2
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</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
Examine ERP5 Site return mapping between a \'reference\' and respective Person object\'s title.\n
This script is used in "No ZODB" approach to get fast search results.\n
"""\n
from Products.ERP5Type.Cache import CachingMethod\n
\n
def getPersonMapAndUidList():\n
result_dict = {}\n
kw[\'portal_type\'] = \'Person\'\n
kw[\'reference\'] = \'!=Null\'\n
person_list = context.portal_catalog(**kw)\n
for person in person_list:\n
person = person.getObject()\n
result_dict[person.getReference()] = {\'title\': person.getTitle(), \n
\'path\': person.getPath()}\n
return result_dict\n
\n
getPersonMapAndUidList = CachingMethod(getPersonMapAndUidList,\n
id = \'ERP5Site_getPersonMapAndUidList\',\n
cache_factory = \'erp5_content_medium\')\n
return getPersonMapAndUidList()\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>**kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_getPersonMapAndUidList</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -87,10 +87,10 @@ SELECT catalog.uid, \n ...@@ -87,10 +87,10 @@ SELECT catalog.uid, \n
catalog.reference, \n catalog.reference, \n
catalog.modification_date,\n catalog.modification_date,\n
catalog.owner,\n catalog.owner,\n
<dtml-if is_full_text_search_on> text, </dtml-if>\n <dtml-if is_full_text_search_on> search_results.text, </dtml-if>\n
category_uid,\n join_category.category_uid,\n
base_category_uid,\n join_category.base_category_uid,\n
category_relative_url,\n join_category.category_relative_url,\n
versioning.version,\n versioning.version,\n
versioning.language\n versioning.language\n
\n \n
...@@ -100,10 +100,10 @@ FROM catalog,\n ...@@ -100,10 +100,10 @@ FROM catalog,\n
<dtml-if is_full_text_search_on>\n <dtml-if is_full_text_search_on>\n
<dtml-if use_text_excerpts>\n <dtml-if use_text_excerpts>\n
/* MySQL server can produc text excerpts */\n /* MySQL server can produc text excerpts */\n
, sphinx_snippets(full_text.SearchableText, \'erp5\', \'<dtml-var "search_string">\') as text\n , sphinx_snippets(full_text.SearchableText, \'erp5\', \'<dtml-var "search_string">\') AS text\n
<dtml-else>\n <dtml-else>\n
/* Return all searchable text to server which will extract found text excerpts */\n /* Return all searchable text to server which will extract found text excerpts */\n
, full_text.SearchableText as text\n , full_text.SearchableText AS text\n
</dtml-if>\n </dtml-if>\n
</dtml-if>\n </dtml-if>\n
<dtml-if "query[\'select_expression\']">\n <dtml-if "query[\'select_expression\']">\n
...@@ -125,13 +125,13 @@ FROM catalog,\n ...@@ -125,13 +125,13 @@ FROM catalog,\n
<dtml-else> LIMIT 1000 </dtml-if>) \n <dtml-else> LIMIT 1000 </dtml-if>) \n
\n \n
AS search_results LEFT JOIN \n AS search_results LEFT JOIN \n
(SELECT category.uid as join_category_uid, \n (SELECT category.uid AS join_category_uid, \n
category.base_category_uid AS base_category_uid,\n category.base_category_uid AS base_category_uid,\n
category.category_uid AS category_uid,\n category.category_uid AS category_uid,\n
catalog.relative_url as category_relative_url\n catalog.relative_url AS category_relative_url\n
FROM category, catalog\n FROM category, catalog\n
WHERE category.category_strict_membership = 1\n WHERE category.category_strict_membership = 1\n
and category.base_category_uid in \n AND category.base_category_uid IN \n
(<dtml-in prefix="loop" expr="base_category_uid_list">\n (<dtml-in prefix="loop" expr="base_category_uid_list">\n
<dtml-if sequence-end>\n <dtml-if sequence-end>\n
<dtml-sqlvar expr="loop_item" type="int">\n <dtml-sqlvar expr="loop_item" type="int">\n
...@@ -139,12 +139,12 @@ FROM catalog,\n ...@@ -139,12 +139,12 @@ FROM catalog,\n
<dtml-sqlvar expr="loop_item" type="int">,\n <dtml-sqlvar expr="loop_item" type="int">,\n
</dtml-if>\n </dtml-if>\n
</dtml-in>)\n </dtml-in>)\n
and category.category_uid = catalog.uid\n AND category.category_uid = catalog.uid\n
\n \n
) AS join_category\n ) AS join_category\n
ON search_results.uid = join_category.join_category_uid\n ON search_results.uid = join_category.join_category_uid\n
\n \n
WHERE search_results.uid = catalog.uid and versioning.uid = catalog.uid\n WHERE search_results.uid = catalog.uid AND versioning.uid = catalog.uid\n
\n \n
</dtml-let> </dtml-let>
......
13 14
\ 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