本文整理汇总了Python中pyinstruments.curvestore.models.CurveDB.params['coucou'+str(i)]方法的典型用法代码示例。如果您正苦于以下问题:Python CurveDB.params['coucou'+str(i)]方法的具体用法?Python CurveDB.params['coucou'+str(i)]怎么用?Python CurveDB.params['coucou'+str(i)]使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyinstruments.curvestore.models.CurveDB
的用法示例。
在下文中一共展示了CurveDB.params['coucou'+str(i)]方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_remove_param
# 需要导入模块: from pyinstruments.curvestore.models import CurveDB [as 别名]
# 或者: from pyinstruments.curvestore.models.CurveDB import params['coucou'+str(i)] [as 别名]
def test_remove_param(self):
curve = CurveDB()
curve.set_data(pandas.Series([1,4,6]))
curve.save()
for i in range(20):
curve.params['coucou' + str(i)] = i
curve.save()
curve = CurveDB.objects.get(id=curve.id)
curve.params.pop("coucou12")
curve.save()
curve = CurveDB.objects.get(id=curve.id)
self.assertTrue("coucou12" not in curve.params)
示例2: test_insert_param
# 需要导入模块: from pyinstruments.curvestore.models import CurveDB [as 别名]
# 或者: from pyinstruments.curvestore.models.CurveDB import params['coucou'+str(i)] [as 别名]
def test_insert_param(self):
curve = CurveDB()
curve.set_data(pandas.Series([1,4,6]))
curve.save()
for i in range(100):
curve.params['coucou' + str(i)] = i
curve.save()
cu = CurveDB.objects.get(id=curve.id)
self.assertTrue(cu.params['coucou12']==12)
cu.params['coucou12'] = 45.
cu.save()
cu2 = CurveDB.objects.get(id=curve.id)
self.assertTrue(cu2.params['coucou12']==45.)
search = CurveDB.objects.filter_param('coucou12', value__gte=44)
self.assertTrue(cu2 in search)