def paginated_list(self): for keyword in Keyword.get_by_domain( self.domain, limit=self.limit, skip=self.skip, ): yield { 'itemData': self._fmt_keyword_data(keyword), 'template': 'keyword-row-template', }
def paginated_list(self): for keyword in Keyword.get_by_domain( self.domain, limit=self.limit, skip=self.skip, ): yield { 'itemData': self._fmt_keyword_data(keyword), 'template': 'keyword-row-template', }
def handle_domain_keywords(v, text, msg, text_words, sessions): any_session_open = len(sessions) > 0 for survey_keyword in Keyword.get_by_domain(v.domain): args = split_args(text, survey_keyword) keyword = args[0].upper() if keyword == survey_keyword.keyword.upper(): if any_session_open and not survey_keyword.override_open_sessions: # We don't want to override any open sessions, so just pass and # let the form session handler handle the message return False elif not contact_can_use_keyword(v, survey_keyword): # The contact type is not allowed to invoke this keyword return False else: inbound_metadata = MessageMetadata(workflow=WORKFLOW_KEYWORD, ) add_msg_tags(msg, inbound_metadata) process_survey_keyword_actions(v, survey_keyword, text, msg) return True # No keywords matched, so pass the message onto the next handler return False
def handle_domain_keywords(v, text, msg, text_words, sessions): any_session_open = len(sessions) > 0 for survey_keyword in Keyword.get_by_domain(v.domain): args = split_args(text, survey_keyword) keyword = args[0].upper() if keyword == survey_keyword.keyword.upper(): if any_session_open and not survey_keyword.override_open_sessions: # We don't want to override any open sessions, so just pass and # let the form session handler handle the message return False elif not contact_can_use_keyword(v, survey_keyword): # The contact type is not allowed to invoke this keyword return False else: inbound_metadata = MessageMetadata( workflow=WORKFLOW_KEYWORD, ) add_msg_tags(msg, inbound_metadata) process_survey_keyword_actions(v, survey_keyword, text, msg) return True # No keywords matched, so pass the message onto the next handler return False
def total(self): return Keyword.get_by_domain(self.domain).count()
def _all_keywords(self): return Keyword.get_by_domain(self.domain)
def total(self): return Keyword.get_by_domain(self.domain).count()