def filter(self, items): if 'CLEAR_SEARCH' in self.request: for parameter in self.parameters: self.request.form[parameter] = '' return items if 'SEARCH_GROUP' in self.request: group = self.groupContainer().get(self.request['SEARCH_GROUP']) if group: int_ids = getUtility(IIntIds) keys = set([int_ids.queryId(person) for person in group.members]) items = [item for item in items if item['id'] in keys] if 'SEARCH_TITLE' in self.request: search_title = self.request['SEARCH_TITLE'] query = buildQueryString(search_title) if query: catalog = ICatalog(self.source) result = catalog['text'].apply(query) items = [item for item in items if item['id'] in result] return items
def filter(self, items): if self.search_title_id in self.request: search_title = self.request[self.search_title_id] query = buildQueryString(search_title) if query: catalog = self.catalog result = catalog['text'].apply(query) items = [item for item in items if item['id'] in result] return items
def filter(self, items): if 'CLEAR_SEARCH' in self.request: for parameter in self.parameters: self.request.form[parameter] = '' return items if 'SEARCH_GROUP' in self.request: group = self.groupContainer().get(self.request['SEARCH_GROUP']) if group: int_ids = getUtility(IIntIds) keys = set( [int_ids.queryId(person) for person in group.members]) items = [item for item in items if item['id'] in keys] if 'SEARCH_TITLE' in self.request: search_title = self.request['SEARCH_TITLE'] query = buildQueryString(search_title) if query: catalog = ICatalog(self.source) result = catalog['text'].apply(query) items = [item for item in items if item['id'] in result] return items