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 ...@@ -101,7 +101,7 @@ else:\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>brain, selection</string> </value> <value> <string>brain, selection, selection_name</string> </value>
</item> </item>
<item> <item>
<key> <string>errors</string> </key> <key> <string>errors</string> </key>
...@@ -121,7 +121,7 @@ else:\n ...@@ -121,7 +121,7 @@ else:\n
<dictionary> <dictionary>
<item> <item>
<key> <string>co_argcount</string> </key> <key> <string>co_argcount</string> </key>
<value> <int>2</int> </value> <value> <int>3</int> </value>
</item> </item>
<item> <item>
<key> <string>co_varnames</string> </key> <key> <string>co_varnames</string> </key>
...@@ -129,6 +129,7 @@ else:\n ...@@ -129,6 +129,7 @@ else:\n
<tuple> <tuple>
<string>brain</string> <string>brain</string>
<string>selection</string> <string>selection</string>
<string>selection_name</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>hasattr</string> <string>hasattr</string>
<string>_getitem_</string> <string>_getitem_</string>
......
...@@ -4,10 +4,10 @@ ...@@ -4,10 +4,10 @@
# Yoshinori Okuji <yo@nexedi.com> # Yoshinori Okuji <yo@nexedi.com>
# #
# WARNING: This program as such is intended to be used by professional # 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 # consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial # 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 # Service Company
# #
# This program is Free Software; you can redistribute it and/or # This program is Free Software; you can redistribute it and/or
...@@ -1375,7 +1375,8 @@ class ListBoxRenderer: ...@@ -1375,7 +1375,8 @@ class ListBoxRenderer:
else: else:
if callable(stat_method): if callable(stat_method):
try: try:
original_value = stat_method(selection = selection) original_value = stat_method(selection = selection,
selection_name = selection.getName())
processed_value = original_value processed_value = original_value
except (ConflictError, RuntimeError): except (ConflictError, RuntimeError):
raise raise
...@@ -1810,7 +1811,8 @@ class ListBoxRendererLine: ...@@ -1810,7 +1811,8 @@ class ListBoxRendererLine:
new_param_dict['closed_summary'] = not self.isOpen() new_param_dict['closed_summary'] = not self.isOpen()
selection.edit(params = new_param_dict, report = self.getDomainSelection()) selection.edit(params = new_param_dict, report = self.getDomainSelection())
try: try:
original_value = stat_method(selection = selection) original_value = stat_method(selection = selection,
selection_name = selection.getName())
processed_value = original_value processed_value = original_value
except (ConflictError, RuntimeError): except (ConflictError, RuntimeError):
raise raise
...@@ -1870,7 +1872,9 @@ class ListBoxRendererLine: ...@@ -1870,7 +1872,9 @@ class ListBoxRendererLine:
if callable(original_value): if callable(original_value):
try: try:
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 processed_value = original_value
except TypeError: except TypeError:
original_value = original_value() original_value = original_value()
...@@ -1962,7 +1966,8 @@ class ListBoxHTMLRendererLine(ListBoxRendererLine): ...@@ -1962,7 +1966,8 @@ class ListBoxHTMLRendererLine(ListBoxRendererLine):
if url_method is not None: if url_method is not None:
try: try:
url = url_method(brain = brain, selection = selection) url = url_method(brain = brain, selection = selection,
selection_name = selection.getName())
except (ConflictError, RuntimeError): except (ConflictError, RuntimeError):
raise raise
except: 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