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


Python FormAccessorSQL.get_attachments方法代码示例

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


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

示例1: test_save_new_form

# 需要导入模块: from corehq.form_processor.backends.sql.dbaccessors import FormAccessorSQL [as 别名]
# 或者: from corehq.form_processor.backends.sql.dbaccessors.FormAccessorSQL import get_attachments [as 别名]
    def test_save_new_form(self):
        unsaved_form = create_form_for_test(DOMAIN, save=False)
        FormAccessorSQL.save_new_form(unsaved_form)
        self.assertTrue(unsaved_form.is_saved())

        attachments = FormAccessorSQL.get_attachments(unsaved_form.form_id)
        self.assertEqual(1, len(attachments))
开发者ID:,项目名称:,代码行数:9,代码来源:

示例2: test_save_form_db_error

# 需要导入模块: from corehq.form_processor.backends.sql.dbaccessors import FormAccessorSQL [as 别名]
# 或者: from corehq.form_processor.backends.sql.dbaccessors.FormAccessorSQL import get_attachments [as 别名]
    def test_save_form_db_error(self):
        form = create_form_for_test(DOMAIN)
        dup_form = create_form_for_test(DOMAIN, save=False)
        dup_form.form_id = form.form_id

        try:
            FormAccessorSQL.save_new_form(dup_form)
        except Exception:
            dup_form.form_id = uuid.uuid4().hex
            FormAccessorSQL.save_new_form(dup_form)
        else:
            self.fail("saving dup form didn't raise an exception")

        attachments = FormAccessorSQL.get_attachments(dup_form.form_id)
        self.assertEqual(1, len(attachments))
开发者ID:dimagi,项目名称:commcare-hq,代码行数:17,代码来源:test_form_dbaccessor.py

示例3: _get_attachments_from_db

# 需要导入模块: from corehq.form_processor.backends.sql.dbaccessors import FormAccessorSQL [as 别名]
# 或者: from corehq.form_processor.backends.sql.dbaccessors.FormAccessorSQL import get_attachments [as 别名]
 def _get_attachments_from_db(self):
     from corehq.form_processor.backends.sql.dbaccessors import FormAccessorSQL
     return FormAccessorSQL.get_attachments(self.form_id)
开发者ID:ansarbek,项目名称:commcare-hq,代码行数:5,代码来源:models.py


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