本文整理汇总了Python中corehq.apps.reminders.models.SurveyKeyword.view方法的典型用法代码示例。如果您正苦于以下问题:Python SurveyKeyword.view方法的具体用法?Python SurveyKeyword.view怎么用?Python SurveyKeyword.view使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类corehq.apps.reminders.models.SurveyKeyword
的用法示例。
在下文中一共展示了SurveyKeyword.view方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_couch_ids
# 需要导入模块: from corehq.apps.reminders.models import SurveyKeyword [as 别名]
# 或者: from corehq.apps.reminders.models.SurveyKeyword import view [as 别名]
def get_couch_ids(self):
result = SurveyKeyword.view(
'reminders/survey_keywords',
include_docs=False,
reduce=False,
).all()
return [row['id'] for row in result]
示例2: get_couch_count
# 需要导入模块: from corehq.apps.reminders.models import SurveyKeyword [as 别名]
# 或者: from corehq.apps.reminders.models.SurveyKeyword import view [as 别名]
def get_couch_count(self):
result = SurveyKeyword.view(
'reminders/survey_keywords',
include_docs=False,
reduce=True,
).all()
if result:
return result[0]['value']
return 0
示例3: getCouchCount
# 需要导入模块: from corehq.apps.reminders.models import SurveyKeyword [as 别名]
# 或者: from corehq.apps.reminders.models.SurveyKeyword import view [as 别名]
def getCouchCount(self):
result = SurveyKeyword.view(
'reminders/survey_keywords',
startkey=[self.domain],
endkey=[self.domain, {}],
include_docs=False,
reduce=True,
).all()
if result:
return result[0]['value']
return 0
示例4: handle
# 需要导入模块: from corehq.apps.reminders.models import SurveyKeyword [as 别名]
# 或者: from corehq.apps.reminders.models.SurveyKeyword import view [as 别名]
def handle(self, *args, **options):
keywords = SurveyKeyword.view("reminders/survey_keywords", reduce=False, include_docs=True).all()
for keyword in keywords:
if keyword.oct13_migration_timestamp is None:
print "Processing keyword %s, %s" % (keyword.domain, keyword._id)
keyword.description = "(none)"
keyword.initiator_doc_type_filter = []
if keyword.form_type == FORM_TYPE_ALL_AT_ONCE:
keyword.override_open_sessions = True
keyword.actions = [SurveyKeywordAction(
recipient = RECIPIENT_SENDER,
recipient_id = None,
action = METHOD_STRUCTURED_SMS,
message_content = None,
form_unique_id = keyword.form_unique_id,
use_named_args = keyword.use_named_args,
named_args = keyword.named_args,
named_args_separator = keyword.named_args_separator,
)]
else:
keyword.override_open_sessions = False
keyword.actions = [SurveyKeywordAction(
recipient = RECIPIENT_SENDER,
recipient_id = None,
action = METHOD_SMS_SURVEY,
message_content = None,
form_unique_id = keyword.form_unique_id,
)]
keyword.form_type = None
keyword.form_unique_id = None
keyword.use_named_args = None
keyword.named_args = None
keyword.named_args_separator = None
keyword.oct13_migration_timestamp = datetime.utcnow()
keyword.save()