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


Python Calculation.create方法代码示例

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


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

示例1: action

# 需要导入模块: from bamboo.models.calculation import Calculation [as 别名]
# 或者: from bamboo.models.calculation.Calculation import create [as 别名]
        def action(dataset):
            if json_file:
                calculations = safe_json_loads(json_file.file.read())
                Calculation.create_from_list_or_dict(dataset, calculations)
                success_message = 'created calculations from JSON'
            elif formula is None or name is None:
                raise ArgumentError('Must provide both formula and name argume'
                                    'nts, or json_file argument')
            else:
                Calculation.create(dataset, formula, name, group)

            return self._success('created calculation: %s' % name, dataset_id)
开发者ID:4sp1r3,项目名称:bamboo,代码行数:14,代码来源:calculations.py

示例2: action

# 需要导入模块: from bamboo.models.calculation import Calculation [as 别名]
# 或者: from bamboo.models.calculation.Calculation import create [as 别名]
        def action(dataset):
            if json_file:
                calculations = safe_json_loads(json_file.file.read())
                Calculation.create_from_list_or_dict(dataset, calculations)
                success_message = "created calculations from JSON for dataset" ":%s" % dataset_id
            elif formula is None or name is None:
                raise ArgumentError("Must provide both formula and name argume" "nts, or json_file argument")
            else:
                Calculation.create(dataset, formula, name, group)
                success_message = "created calculation: %s for dataset: %s" % (name, dataset_id)

            return {self.SUCCESS: success_message}
开发者ID:j,项目名称:bamboo,代码行数:14,代码来源:calculations.py

示例3: _action

# 需要导入模块: from bamboo.models.calculation import Calculation [as 别名]
# 或者: from bamboo.models.calculation.Calculation import create [as 别名]
        def _action(dataset):
            if json_file:
                calculations = json.loads(json_file.file.read())
                Calculation.create_from_list_or_dict(dataset, calculations)
                success_message = ('created calculations from JSON for dataset'
                                   ':%s' % dataset_id)
            elif formula is None or name is None:
                raise ArgumentError('Must provide both formula and name argume'
                                    'nts, or json_file argument')
            else:
                Calculation.create(dataset, formula, name, group)
                success_message = 'created calculation: %s for dataset: %s' % (
                    name, dataset_id)

            return {self.SUCCESS: success_message}
开发者ID:helioid,项目名称:bamboo,代码行数:17,代码来源:calculations.py

示例4: _save_calculation

# 需要导入模块: from bamboo.models.calculation import Calculation [as 别名]
# 或者: from bamboo.models.calculation.Calculation import create [as 别名]
 def _save_calculation(self, formula):
     if not formula:
         formula = self.formula
     return Calculation.create(self.dataset, formula, self.name)
开发者ID:4sp1r3,项目名称:bamboo,代码行数:6,代码来源:test_calculation.py


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