Commit 5b8325ed authored by Kevin Deldycke's avatar Kevin Deldycke

Add getListMethodName on Listboxes.

Fix code indention.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@8879 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c8b8bf09
......@@ -2897,6 +2897,16 @@ class ListBox(ZMIField):
else:
return ZMIField.get_value(self, id, **kw)
security.declareProtected('Access contents information', 'getListMethodName')
def getListMethodName(self):
"""Return the name of the list method. If not defined, return None.
"""
list_method = self.get_value('list_method')
try:
name = getattr(list_method, 'method_name')
except AttributeError:
name = list_method
return name or None
class ListBoxLine:
......
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