本文整理汇总了Python中corehq.apps.reminders.models.CaseReminderHandler.wrap方法的典型用法代码示例。如果您正苦于以下问题:Python CaseReminderHandler.wrap方法的具体用法?Python CaseReminderHandler.wrap怎么用?Python CaseReminderHandler.wrap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类corehq.apps.reminders.models.CaseReminderHandler
的用法示例。
在下文中一共展示了CaseReminderHandler.wrap方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: handle
# 需要导入模块: from corehq.apps.reminders.models import CaseReminderHandler [as 别名]
# 或者: from corehq.apps.reminders.models.CaseReminderHandler import wrap [as 别名]
def handle(self, *args, **options):
ids = self.get_reminder_definition_ids()
for handler_doc in iter_docs(CaseReminderHandler.get_db(), ids):
handler = CaseReminderHandler.wrap(handler_doc)
if handler.reminder_type == REMINDER_TYPE_DEFAULT:
self.check_for_ui_type(handler)
self.check_for_multiple_fire_time_types(handler)
self.check_for_datetime_criteria(handler)
self.check_for_case_group_recipient(handler)
示例2: _active_reminders
# 需要导入模块: from corehq.apps.reminders.models import CaseReminderHandler [as 别名]
# 或者: from corehq.apps.reminders.models.CaseReminderHandler import wrap [as 别名]
def _active_reminders(self):
db = CaseReminderHandler.get_db()
key = [self.domain.name]
reminder_rules = db.view(
'reminders/handlers_by_reminder_type',
startkey=key,
endkey=key+[{}],
reduce=False
).all()
active_reminders = []
for reminder_doc in iter_docs(db, [r['id'] for r in reminder_rules]):
if reminder_doc.get('active', True):
active_reminders.append(CaseReminderHandler.wrap(reminder_doc))
return active_reminders
示例3: get_active_reminders_by_domain_name
# 需要导入模块: from corehq.apps.reminders.models import CaseReminderHandler [as 别名]
# 或者: from corehq.apps.reminders.models.CaseReminderHandler import wrap [as 别名]
def get_active_reminders_by_domain_name(domain_name):
from corehq.apps.reminders.models import CaseReminderHandler, REMINDER_TYPE_DEFAULT, REMINDER_TYPE_KEYWORD_INITIATED
db = CaseReminderHandler.get_db()
key = [domain_name]
reminder_rules = db.view(
"reminders/handlers_by_reminder_type", startkey=key, endkey=(key + [{}]), reduce=False
).all()
return [
CaseReminderHandler.wrap(reminder_doc)
for reminder_doc in iter_docs(db, [r["id"] for r in reminder_rules])
if (
reminder_doc.get("active", True)
and reminder_doc.get("reminder_type", REMINDER_TYPE_DEFAULT) != REMINDER_TYPE_KEYWORD_INITIATED
)
]