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


Python PrepTemplate.exists方法代码示例

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


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

示例1: test_post

# 需要导入模块: from qiita_db.metadata_template.prep_template import PrepTemplate [as 别名]
# 或者: from qiita_db.metadata_template.prep_template.PrepTemplate import exists [as 别名]
 def test_post(self):
     new_prep_id = get_count('qiita.prep_template') + 1
     arguments = {'study_id': '1',
                  'data-type': '16S',
                  'prep-file': 'new_template.txt'}
     response = self.post('/prep_template/', arguments)
     self.assertEqual(response.code, 200)
     # Check that the new prep template has been created
     self.assertTrue(PrepTemplate.exists(new_prep_id))
开发者ID:antgonza,项目名称:qiita,代码行数:11,代码来源:test_prep_template.py

示例2: _check_prep_template_exists

# 需要导入模块: from qiita_db.metadata_template.prep_template import PrepTemplate [as 别名]
# 或者: from qiita_db.metadata_template.prep_template.PrepTemplate import exists [as 别名]
def _check_prep_template_exists(prep_id):
    """Make sure a prep template exists in the system

    Parameters
    ----------
    prep_id : int or str castable to int
        PrepTemplate id to check

    Returns
    -------
    dict
        {'status': status,
         'message': msg}
    """
    if not PrepTemplate.exists(int(prep_id)):
        return {'status': 'error',
                'message': 'Prep template %d does not exist' % int(prep_id)
                }
    return {'status': 'success',
            'message': ''}
开发者ID:ElDeveloper,项目名称:qiita,代码行数:22,代码来源:prep_template.py


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