本文整理汇总了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)
示例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
示例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)
示例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)