Commit 460e8361 authored by Boris Kocherov's avatar Boris Kocherov Committed by Boris Kocherov

add isFiltred in backend

parent 29aa0cc9
......@@ -706,22 +706,40 @@ class ListBoxRenderer:
# we show all rows and do not care to hide anything
return 0
# ignore_hide_rows parameter force to display the content
ignore_hide_rows = REQUEST.get('ignore_hide_rows', 0)
if ignore_hide_rows:
return 0
return self.isNotFiltered()
@lazyMethod
def isFiltered(self):
"""Return True if listbox content filtered
"""
return not self.isNotFiltered()
@lazyMethod
def isNotFiltered(self):
"""Return False if listbox content filtered
"""
# Always display lines in report mode
if self.isReportTreeMode():
return 0
# In domain mode, returns lines only if a domain is selected
if self.isDomainTreeMode():
if self.getDomainSelection():
return 0
domain_selection = self.getDomainSelection()
if domain_selection and (len(domain_selection) > 0):
return 0
# ignore_hide_rows parameter force to display the content
ignore_hide_rows = REQUEST.get('ignore_hide_rows', 0)
if ignore_hide_rows:
# Always display lines in invert mode (filter by checked uids)
if self.getSelection().isInvertMode():
return 0
# we could hide rows only if missing in request or selection search criterions
selection_params = self.getSelection().getParams()
REQUEST = self.request
# Try to get workflow state parameter, in order to always allow worklist display
# guess all column names from catalog schema
......
......@@ -433,7 +433,7 @@ class DomainSelection(Acquisition.Implicit, Traversable, Persistent):
setattr(self, k, v)
def __len__(self):
return len(self.domain_dict)
return len([1 for i in self.domain_dict if i is not None])
security.declarePublic('getCategoryList')
def getCategoryList(self):
......
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