当前位置: 首页>>代码示例>>Python>>正文


Python SurveyKeyword.view方法代码示例

本文整理汇总了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]
开发者ID:,项目名称:,代码行数:9,代码来源:

示例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
开发者ID:,项目名称:,代码行数:11,代码来源:

示例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
开发者ID:,项目名称:,代码行数:13,代码来源:

示例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()
开发者ID:LifeCoaching,项目名称:commcare-hq,代码行数:38,代码来源:migrate_keywords.py


注:本文中的corehq.apps.reminders.models.SurveyKeyword.view方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。