Commit 160d47fe authored by Romain Courteaud's avatar Romain Courteaud

No need to manually define the table name, as the catalog automatically generate the mapping.

This allow to directly call the attribute on the result objects.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@26660 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 296d63d1
...@@ -59,8 +59,9 @@ if depth == 0:\n ...@@ -59,8 +59,9 @@ if depth == 0:\n
task_uid_list = context.portal_selections.getSelectionUidList(context=context, selection_name=\'task_module_selection\')\n task_uid_list = context.portal_selections.getSelectionUidList(context=context, selection_name=\'task_module_selection\')\n
person_result = context.portal_catalog(portal_type=["Person",],\n person_result = context.portal_catalog(portal_type=["Person",],\n
source_related_uid=task_uid_list,\n source_related_uid=task_uid_list,\n
select_expression=\'catalog.portal_type, catalog.relative_url, catalog.id, catalog.title\',\n select_expression=\'relative_url, id, title\',\n
sort_on = ((\'title\',\'ascending\'),))\n sort_on = ((\'title\',\'ascending\'),))\n
\n
person_dict = {}\n person_dict = {}\n
person_list = []\n person_list = []\n
append = person_list.append\n append = person_list.append\n
...@@ -69,7 +70,7 @@ if depth == 0:\n ...@@ -69,7 +70,7 @@ if depth == 0:\n
if key not in person_dict:\n if key not in person_dict:\n
person_dict[key] = None\n person_dict[key] = None\n
category_dict = {\'relative_url\':person.relative_url, \n category_dict = {\'relative_url\':person.relative_url, \n
\'portal_type\':person.portal_type,\n \'portal_type\': \'Person\',\n
\'id\':person.id,\n \'id\':person.id,\n
\'title\':person.title,\n \'title\':person.title,\n
\'uid\':person.uid}\n \'uid\':person.uid}\n
......
...@@ -63,11 +63,11 @@ def Task_getRelatedSourceProject(depth, parent_relative_url=None):\n ...@@ -63,11 +63,11 @@ def Task_getRelatedSourceProject(depth, parent_relative_url=None):\n
task_uid_list = context.portal_selections.getSelectionUidList(context=context, selection_name=\'task_module_selection\')\n task_uid_list = context.portal_selections.getSelectionUidList(context=context, selection_name=\'task_module_selection\')\n
project_result = context.portal_catalog(portal_type=["Project", "Project Line"],\n project_result = context.portal_catalog(portal_type=["Project", "Project Line"],\n
source_project_related_uid=task_uid_list,\n source_project_related_uid=task_uid_list,\n
select_expression=\'catalog.portal_type, catalog.relative_url, catalog.id, catalog.title\',\n select_expression=\'portal_type, relative_url, id, title\',\n
sort_on = ((\'title\',\'ascending\'),))\n sort_on = ((\'title\',\'ascending\'),))\n
else:\n else:\n
project_result = context.portal_catalog(portal_type=["Project Line", "Project Milestones"],\n project_result = context.portal_catalog(portal_type=["Project Line", "Project Milestones"],\n
select_expression=\'catalog.portal_type, catalog.relative_url, catalog.id, catalog.title\',\n select_expression=\'portal_type, relative_url, id, title\',\n
parent_relative_url=parent_relative_url,\n parent_relative_url=parent_relative_url,\n
sort_on = ((\'title\',\'ascending\'),))\n sort_on = ((\'title\',\'ascending\'),))\n
# use a dict to store catalog result\n # use a dict to store catalog result\n
......
...@@ -59,7 +59,7 @@ if depth == 0:\n ...@@ -59,7 +59,7 @@ if depth == 0:\n
task_uid_list = context.portal_selections.getSelectionUidList(context=context, selection_name=\'task_report_module_selection\')\n task_uid_list = context.portal_selections.getSelectionUidList(context=context, selection_name=\'task_report_module_selection\')\n
person_result = context.portal_catalog(portal_type=["Person",],\n person_result = context.portal_catalog(portal_type=["Person",],\n
source_related_uid=task_uid_list,\n source_related_uid=task_uid_list,\n
select_expression=\'catalog.portal_type, catalog.relative_url, catalog.id, catalog.title\',\n select_expression=\'portal_type, relative_url, id, title\',\n
sort_on = ((\'title\',\'ascending\'),))\n sort_on = ((\'title\',\'ascending\'),))\n
person_dict = {}\n person_dict = {}\n
person_list = []\n person_list = []\n
...@@ -69,7 +69,7 @@ if depth == 0:\n ...@@ -69,7 +69,7 @@ if depth == 0:\n
if key not in person_dict:\n if key not in person_dict:\n
person_dict[key] = None\n person_dict[key] = None\n
category_dict = {\'relative_url\':person.relative_url, \n category_dict = {\'relative_url\':person.relative_url, \n
\'portal_type\':person.portal_type,\n \'portal_type\': "Person",\n
\'id\':person.id,\n \'id\':person.id,\n
\'title\':person.title,\n \'title\':person.title,\n
\'uid\':person.uid}\n \'uid\':person.uid}\n
......
...@@ -63,11 +63,11 @@ def Task_getRelatedSourceProject(depth, parent_relative_url=None):\n ...@@ -63,11 +63,11 @@ def Task_getRelatedSourceProject(depth, parent_relative_url=None):\n
task_uid_list = context.portal_selections.getSelectionUidList(context=context, selection_name=\'task_report_module_selection\')\n task_uid_list = context.portal_selections.getSelectionUidList(context=context, selection_name=\'task_report_module_selection\')\n
project_result = context.portal_catalog(portal_type=["Project", "Project Line"],\n project_result = context.portal_catalog(portal_type=["Project", "Project Line"],\n
source_project_related_uid=task_uid_list,\n source_project_related_uid=task_uid_list,\n
select_expression=\'catalog.portal_type, catalog.relative_url, catalog.id, catalog.title\',\n select_expression=\'portal_type, relative_url, id, title\',\n
sort_on = ((\'title\',\'ascending\'),))\n sort_on = ((\'title\',\'ascending\'),))\n
else:\n else:\n
project_result = context.portal_catalog(portal_type=["Project Line", "Project Milestones"],\n project_result = context.portal_catalog(portal_type=["Project Line", "Project Milestones"],\n
select_expression=\'catalog.portal_type, catalog.relative_url, catalog.id, catalog.title\',\n select_expression=\'portal_type, relative_url, id, title\',\n
parent_relative_url=parent_relative_url,\n parent_relative_url=parent_relative_url,\n
sort_on = ((\'title\',\'ascending\'),))\n sort_on = ((\'title\',\'ascending\'),))\n
# use a dict to store catalog result\n # use a dict to store catalog result\n
......
634 636
\ 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