Commit 084a9864 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

pass selection_name in url_method and stat_method.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13532 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 06fd2fb2
......@@ -101,7 +101,7 @@ else:\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>brain, selection</string> </value>
<value> <string>brain, selection, selection_name</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
......@@ -121,7 +121,7 @@ else:\n
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>2</int> </value>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
......@@ -129,6 +129,7 @@ else:\n
<tuple>
<string>brain</string>
<string>selection</string>
<string>selection_name</string>
<string>_getattr_</string>
<string>hasattr</string>
<string>_getitem_</string>
......
......@@ -4,10 +4,10 @@
# Yoshinori Okuji <yo@nexedi.com>
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
......@@ -1375,7 +1375,8 @@ class ListBoxRenderer:
else:
if callable(stat_method):
try:
original_value = stat_method(selection = selection)
original_value = stat_method(selection = selection,
selection_name = selection.getName())
processed_value = original_value
except (ConflictError, RuntimeError):
raise
......@@ -1810,7 +1811,8 @@ class ListBoxRendererLine:
new_param_dict['closed_summary'] = not self.isOpen()
selection.edit(params = new_param_dict, report = self.getDomainSelection())
try:
original_value = stat_method(selection = selection)
original_value = stat_method(selection = selection,
selection_name = selection.getName())
processed_value = original_value
except (ConflictError, RuntimeError):
raise
......@@ -1870,7 +1872,9 @@ class ListBoxRendererLine:
if callable(original_value):
try:
try:
original_value = original_value(brain = self.getBrain(), selection = selection)
original_value = original_value(brain = self.getBrain(),
selection = selection,
selection_name = selection.getName())
processed_value = original_value
except TypeError:
original_value = original_value()
......@@ -1962,7 +1966,8 @@ class ListBoxHTMLRendererLine(ListBoxRendererLine):
if url_method is not None:
try:
url = url_method(brain = brain, selection = selection)
url = url_method(brain = brain, selection = selection,
selection_name = selection.getName())
except (ConflictError, RuntimeError):
raise
except:
......
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