本文整理汇总了Python中treemap.models.Plot.id方法的典型用法代码示例。如果您正苦于以下问题:Python Plot.id方法的具体用法?Python Plot.id怎么用?Python Plot.id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类treemap.models.Plot
的用法示例。
在下文中一共展示了Plot.id方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_tree_hash_to_model
# 需要导入模块: from treemap.models import Plot [as 别名]
# 或者: from treemap.models.Plot import id [as 别名]
def test_tree_hash_to_model(self):
test_plot = Plot(geom=Point(0, 0), instance=self.instance)
test_plot.id = 95
test_plot.save_with_user(self.commander)
tree_dict = json.loads(self.tree_blob)
tree = hash_to_model('tree', tree_dict, self.instance,
self.commander)
tree.save_with_user(self.commander)
self.assertEqual(tree.plot, test_plot)
self.assertEqual(tree.species, None)
self.assertEqual(tree.readonly, True)
self.assertEqual(tree.diameter, 0.2900001566)
self.assertEqual(tree.canopy_height, None)
self.assertEqual(tree.date_planted, None)
self.assertEqual(tree.date_removed, None)
示例2: test_tree_hash_to_model
# 需要导入模块: from treemap.models import Plot [as 别名]
# 或者: from treemap.models.Plot import id [as 别名]
def test_tree_hash_to_model(self):
test_plot = Plot(geom=Point(0, 0), instance=self.instance)
test_plot.id = 95
test_plot.save_with_user(self.commander)
test_species = Species(instance=self.instance, otm_code="1",
common_name="asdfa", genus="sdfs")
test_species.id = 85
test_species.save_with_user(self.commander)
tree_dict = json.loads(self.tree_blob)
tree = hash_to_model(MIGRATION_RULES,
'tree', tree_dict, self.instance)
tree.save_with_user(self.commander)
tree = Tree.objects.get(pk=tree.pk)
self.assertEqual(tree.plot, test_plot)
self.assertEqual(tree.species, test_species)
self.assertEqual(tree.readonly, True)
self.assertEqual(tree.diameter, 0.2900001566)
self.assertEqual(tree.canopy_height, None)
self.assertEqual(tree.date_planted, None)
self.assertEqual(tree.date_removed, None)