Commit 7fa2fe42 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

objectValues() also supports portal_type and meta_type arguments.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@20346 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent df1963f2
...@@ -941,28 +941,24 @@ class ListBoxRenderer: ...@@ -941,28 +941,24 @@ class ListBoxRenderer:
list_method_name = self.getListMethodName() list_method_name = self.getListMethodName()
meta_type_list = self.getMetaTypeList() meta_type_list = self.getMetaTypeList()
portal_type_list = self.getPortalTypeList() portal_type_list = self.getPortalTypeList()
if list_method_name == 'objectValues': if portal_type_list is not None:
if meta_type_list is not None: params.setdefault('portal_type', portal_type_list)
params.setdefault('spec', meta_type_list) elif meta_type_list is not None:
else: params.setdefault('meta_type', meta_type_list)
if portal_type_list is not None:
params.setdefault('portal_type', portal_type_list) # Remove useless parameters as FileUpload
elif meta_type_list is not None: for k, v in params.items():
params.setdefault('meta_type', meta_type_list) if k == "listbox":
# listbox can also contain useless parameters
# Remove useless parameters as FileUpload new_list = []
for k, v in params.items(): for line in v:
if k == "listbox": for k1, v1 in line.items():
# listbox can also contain useless parameters if v1 in (None, '') or hasattr(v1, 'read'):
new_list = [] del line[k1]
for line in v: new_list.append(line)
for k1, v1 in line.items(): params[k] = new_list
if v1 in (None, '') or hasattr(v1, 'read'): if v in (None, '') or hasattr(v, 'read'):
del line[k1] del params[k]
new_list.append(line)
params[k] = new_list
if v in (None, '') or hasattr(v, 'read'):
del params[k]
# remove some erp5_xhtml_style specific parameters # remove some erp5_xhtml_style specific parameters
params.pop('saved_form_data', None) params.pop('saved_form_data', None)
......
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