Commit b42ecf80 authored by Jean-Paul Smets's avatar Jean-Paul Smets

by seb: call list_method with parameters


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@674 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 80b45834
...@@ -668,7 +668,7 @@ class ListBoxWidget(Widget.Widget): ...@@ -668,7 +668,7 @@ class ListBoxWidget(Widget.Widget):
# PERFORMANCE # PERFORMANCE
report_sections = ( (None, 0, 0, object_list, len(object_list), 0), ) report_sections = ( (None, 0, 0, object_list, len(object_list), 0), )
object_uid_list = map(lambda x: x.uid, object_list) object_uid_list = map(lambda x: getattr(x, 'uid', None), object_list)
LOG('ListBox.render, object_uid_list:',0,object_uid_list) LOG('ListBox.render, object_uid_list:',0,object_uid_list)
# Then construct the md5 corresponding this uid list # Then construct the md5 corresponding this uid list
# It is used in order to do some checks in scripts. # It is used in order to do some checks in scripts.
...@@ -1180,6 +1180,8 @@ class ListBoxValidator(Validator.Validator): ...@@ -1180,6 +1180,8 @@ class ListBoxValidator(Validator.Validator):
all_editable_column_ids = map(lambda x: x[0], all_editable_columns) all_editable_column_ids = map(lambda x: x[0], all_editable_columns)
selection_name = field.get_value('selection_name') selection_name = field.get_value('selection_name')
selection = here.portal_selections.getSelectionFor(selection_name, REQUEST=REQUEST) selection = here.portal_selections.getSelectionFor(selection_name, REQUEST=REQUEST)
params = selection.getSelectionParams()
result = {} result = {}
error_result = {} error_result = {}
...@@ -1196,7 +1198,7 @@ class ListBoxValidator(Validator.Validator): ...@@ -1196,7 +1198,7 @@ class ListBoxValidator(Validator.Validator):
if str(uid).find('new') == 0: if str(uid).find('new') == 0:
list_method = field.get_value('list_method') list_method = field.get_value('list_method')
list_method = getattr(here, list_method.method_name) list_method = getattr(here, list_method.method_name)
object_list = list_method(REQUEST=REQUEST) object_list = list_method(REQUEST=REQUEST, **params)
break break
listbox = {} listbox = {}
for uid in listbox_uids: for uid in listbox_uids:
...@@ -1233,7 +1235,7 @@ class ListBoxValidator(Validator.Validator): ...@@ -1233,7 +1235,7 @@ class ListBoxValidator(Validator.Validator):
list_method = field.get_value('list_method') list_method = field.get_value('list_method')
list_method = getattr(here, list_method.method_name) list_method = getattr(here, list_method.method_name)
REQUEST.set('listbox',listbox) REQUEST.set('listbox',listbox)
object_list = list_method(REQUEST=REQUEST) object_list = list_method(REQUEST=REQUEST,**params)
for uid in listbox_uids: for uid in listbox_uids:
if str(uid).find('new') == 0: if str(uid).find('new') == 0:
# First case: dialog input to create new objects # First case: dialog input to create new objects
......
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