def __call__(self): searchable = [] # append some other attributes to the searchableText index # reference_number refNumb = getAdapter(self.context, IReferenceNumber) searchable.append(refNumb.get_number()) # sequence_number seqNumb = getUtility(ISequenceNumber) searchable.append(str(seqNumb.get_number(self.context))) # responsible searchable.append(self.context.responsible_label.encode('utf-8')) # filing_no if IFilingNumberMarker.providedBy(self.context): filing_no = getattr(IFilingNumber(self.context), 'filing_no', None) if filing_no: searchable.append(filing_no.encode('utf-8')) # comments comments = getattr(IDossier(self.context), 'comments', None) if comments: searchable.append(comments.encode('utf-8')) # keywords keywords = IDossier(self.context).keywords if keywords: searchable.extend( keyword.encode('utf-8') if isinstance(keyword, unicode) else keyword for keyword in keywords) return ' '.join(searchable)
def is_archive_form_needed(self): if not IFilingNumberMarker.providedBy(self.context): return False if self.context.is_subdossier(): return False else: return True
def __call__(self): searchable = [] # append some other attributes to the searchableText index # reference_number refNumb = getAdapter(self.context, IReferenceNumber) searchable.append(refNumb.get_number()) # sequence_number seqNumb = getUtility(ISequenceNumber) searchable.append(str(seqNumb.get_number(self.context))) # responsible searchable.append(self.context.responsible_label.encode('utf-8')) # filing_no if IFilingNumberMarker.providedBy(self.context): filing_no = getattr(IFilingNumber(self.context), 'filing_no', None) if filing_no: searchable.append(filing_no.encode('utf-8')) # comments comments = getattr(IDossier(self.context), 'comments', None) if comments: searchable.append(comments.encode('utf-8')) # keywords keywords = IDossier(self.context).keywords if keywords: searchable.extend( keyword.encode('utf-8') if isinstance(keyword, unicode) else keyword for keyword in keywords) searchable_external_reference = IDossier(self.context).external_reference if searchable_external_reference: searchable.append(searchable_external_reference.encode('utf-8')) return ' '.join(searchable)