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


Python CaseReminderHandler.get_handlers_from_ids方法代码示例

本文整理汇总了Python中corehq.apps.reminders.models.CaseReminderHandler.get_handlers_from_ids方法的典型用法代码示例。如果您正苦于以下问题:Python CaseReminderHandler.get_handlers_from_ids方法的具体用法?Python CaseReminderHandler.get_handlers_from_ids怎么用?Python CaseReminderHandler.get_handlers_from_ids使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在corehq.apps.reminders.models.CaseReminderHandler的用法示例。


在下文中一共展示了CaseReminderHandler.get_handlers_from_ids方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _case_changed

# 需要导入模块: from corehq.apps.reminders.models import CaseReminderHandler [as 别名]
# 或者: from corehq.apps.reminders.models.CaseReminderHandler import get_handlers_from_ids [as 别名]
def _case_changed(case_id, handler_ids):
    subcases = None
    case = CommCareCase.get(case_id)
    for handler in CaseReminderHandler.get_handlers_from_ids(handler_ids):
        if handler.start_condition_type == CASE_CRITERIA:
            handler.case_changed(case)
            if handler.uses_parent_case_property:
                if subcases is None:
                    subcases = get_subcases(case)
                for subcase in subcases:
                    handler.case_changed(subcase)
开发者ID:jmaina,项目名称:commcare-hq,代码行数:13,代码来源:tasks.py

示例2: format_broadcast_data

# 需要导入模块: from corehq.apps.reminders.models import CaseReminderHandler [as 别名]
# 或者: from corehq.apps.reminders.models.CaseReminderHandler import get_handlers_from_ids [as 别名]
 def format_broadcast_data(self, ids):
     broadcasts = CaseReminderHandler.get_handlers_from_ids(ids)
     result = []
     for broadcast in broadcasts:
         display = self.format_broadcast_name(broadcast)
         result.append([
             display,
             self.format_recipients(broadcast),
             self.format_content(broadcast),
             broadcast._id,
             reverse(EditBroadcastView.urlname, args=[self.domain, broadcast._id]),
             reverse(CopyBroadcastView.urlname, args=[self.domain, broadcast._id]),
         ])
     return result
开发者ID:saketkanth,项目名称:commcare-hq,代码行数:16,代码来源:views.py

示例3: _case_changed

# 需要导入模块: from corehq.apps.reminders.models import CaseReminderHandler [as 别名]
# 或者: from corehq.apps.reminders.models.CaseReminderHandler import get_handlers_from_ids [as 别名]
def _case_changed(case_id, handler_ids):
    subcases = None
    case = CommCareCase.get(case_id)
    for handler in CaseReminderHandler.get_handlers_from_ids(handler_ids):
        if handler.start_condition_type == CASE_CRITERIA:
            kwargs = {}
            if handler.uses_time_case_property:
                kwargs = {"schedule_changed": True, "prev_definition": handler}
            handler.case_changed(case, **kwargs)
            if handler.uses_parent_case_property:
                if subcases is None:
                    subcases = get_subcases(case)
                for subcase in subcases:
                    handler.case_changed(subcase, **kwargs)
开发者ID:philipkaare,项目名称:commcare-hq,代码行数:16,代码来源:tasks.py

示例4: _case_changed

# 需要导入模块: from corehq.apps.reminders.models import CaseReminderHandler [as 别名]
# 或者: from corehq.apps.reminders.models.CaseReminderHandler import get_handlers_from_ids [as 别名]
def _case_changed(domain, case_id, handler_ids):
    case = CaseAccessors(domain).get_case(case_id)
    for handler in CaseReminderHandler.get_handlers_from_ids(handler_ids):
        if handler.start_condition_type == CASE_CRITERIA:
            kwargs = {}
            if handler.uses_time_case_property:
                kwargs = {
                    'schedule_changed': True,
                    'prev_definition': handler,
                }
            handler.case_changed(case, **kwargs)
            if handler.uses_parent_case_property:
                subcases = case.get_subcases(index_identifier=DEFAULT_PARENT_IDENTIFIER)
                for subcase in subcases:
                    handler.case_changed(subcase, **kwargs)
开发者ID:saketkanth,项目名称:commcare-hq,代码行数:17,代码来源:tasks.py


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