Commit 6623eb1f authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

* revise some docstrings.

* use list comprehension instead of map().
* remove needress import of DomainSelection from PlanningBox.py.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@12892 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 3c16cb5d
...@@ -54,7 +54,7 @@ from DateTime import DateTime ...@@ -54,7 +54,7 @@ from DateTime import DateTime
from Products.Formulator import Widget, Validator from Products.Formulator import Widget, Validator
from Products.Formulator.Errors import FormValidationError, ValidationError from Products.Formulator.Errors import FormValidationError, ValidationError
from SelectionTool import makeTreeList,TreeListLine from SelectionTool import makeTreeList,TreeListLine
from Selection import Selection, DomainSelection from Selection import Selection
import OFS import OFS
from AccessControl import ClassSecurityInfo from AccessControl import ClassSecurityInfo
from zLOG import LOG from zLOG import LOG
......
...@@ -251,7 +251,8 @@ class SelectionTool( UniqueObject, SimpleItem ): ...@@ -251,7 +251,8 @@ class SelectionTool( UniqueObject, SimpleItem ):
def updateSelectionCheckedUidList(self, selection_name, listbox_uid, uids, REQUEST=None): def updateSelectionCheckedUidList(self, selection_name, listbox_uid, uids, REQUEST=None):
""" """
Updates the checked uids for a given selection_name Updates the unchecked uids(listbox_uids) and checked uids (uids)
for a given selection_name
""" """
if listbox_uid is None: if listbox_uid is None:
listbox_uid = [] listbox_uid = []
...@@ -425,7 +426,8 @@ class SelectionTool( UniqueObject, SimpleItem ): ...@@ -425,7 +426,8 @@ class SelectionTool( UniqueObject, SimpleItem ):
security.declareProtected(ERP5Permissions.View, 'getSelectionColumns') security.declareProtected(ERP5Permissions.View, 'getSelectionColumns')
def getSelectionColumns(self, selection_name, columns=None, REQUEST=None): def getSelectionColumns(self, selection_name, columns=None, REQUEST=None):
""" """
Returns the columns in the selection Returns the columns in the selection if not empty, otherwise
returns the value of columns argument
""" """
if columns is None: columns = [] if columns is None: columns = []
selection = self.getSelectionFor(selection_name, REQUEST=REQUEST) selection = self.getSelectionFor(selection_name, REQUEST=REQUEST)
...@@ -906,7 +908,7 @@ class SelectionTool( UniqueObject, SimpleItem ): ...@@ -906,7 +908,7 @@ class SelectionTool( UniqueObject, SimpleItem ):
""" """
Get the list of values checked or selected for 'selection_name' Get the list of values checked or selected for 'selection_name'
""" """
return map(lambda x:x.getObject().getUid(), self.getSelectionValueList(selection_name, REQUEST=REQUEST, selection_method=selection_method, context=context)) return [x.getObject().getUid() for x in self.getSelectionValueList(selection_name, REQUEST=REQUEST, selection_method=selection_method, context=context)]
security.declareProtected(ERP5Permissions.View, 'selectionHasChanged') security.declareProtected(ERP5Permissions.View, 'selectionHasChanged')
def selectionHasChanged(self, md5_string, object_uid_list): def selectionHasChanged(self, md5_string, object_uid_list):
......
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