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


Python Tree.cluster_id方法代码示例

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


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

示例1: handle_row

# 需要导入模块: from treemap.models import Tree [as 别名]
# 或者: from treemap.models.Tree import cluster_id [as 别名]

#.........这里部分代码省略.........
            if row.get("BURROWS"):
                tree.burrows = str(row["BURROWS"])

            if row.get("FLOWERS"):
                tree.flowers = str(row["FLOWERS"])

            if row.get("FRUITS"):
                tree.fruits = str(row["FRUITS"])

            if row.get("NAILS"):
                tree.nails = str(row["NAILS"])

            if row.get("POSTER"):
                tree.poster = str(row["POSTER"])

            if row.get("WIRES"):
                tree.wires = str(row["WIRES"])

            if row.get("TREE_GUARD"):
                tree.tree_guard = str(row["TREE_GUARD"])

            if row.get("NUISANCE"):
                tree.other_nuisance = bool(row["NUISANCE"])

            if row.get("NUISANCE_DESC"):
                tree.other_nuisance_desc = str(row["NUISANCE_DESC"])

            if row.get("HEALTH_OF_TREE"):
                tree.health_of_tree = str(row["HEALTH_OF_TREE"])

            if row.get("FOUND_ON_GROUND"):
                tree.found_on_ground = str(row["FOUND_ON_GROUND"])

            if row.get("GROUND_DESCRIPTION"):
                tree.ground_description = str(row["GROUND_DESCRIPTION"])

            if row.get("RISK_ON_TREE"):
                tree.risk_on_tree = str(row["RISK_ON_TREE"])

            if row.get("RISK_DESC"):
                tree.risk_desc = str(row["RISK_DESC"])

            if row.get("PEST_AFFECTED"):
                tree.pests = str(row["PEST_AFFECTED"])

            if row.get("REFER_TO_DEPT"):
                tree.refer_to_dept = str(row["REFER_TO_DEPT"])

            if row.get("SPECIAL_OTHER"):
                tree.special_other = str(row["SPECIAL_OTHER"])

            if row.get("SPECIAL_OTHER_DESCRIPTION"):
                tree.special_other_description = str(row["SPECIAL_OTHER_DESCRIPTION"])

            if row.get("LATITUDE"):
                tree.latitude = str(row["LATITUDE"])

            if row.get("LONGITUDE"):
                tree.longitude = str(row["LONGITUDE"])

            if row.get("PRABHAG_ID"):
                tree.prabhag_id = str(row["PRABHAG_ID"])

            if row.get("CLUSTER_ID"):
                tree.cluster_id = str(row["CLUSTER_ID"])

            # if row.get('ID'):
            #    tree.id = str(row['ID'])

            # import pdb; pdb.set_trace()

            f = open("trees_in_otm_obj.log", "w")
            f.write("b4 save")
            f.write(str(tree.__dict__))
            tree.quick_save()
            f.write("after save \n")
            f.write(str(tree.__dict__))
            f.close()

            if row.get("PROJECT_1"):
                for k, v in Choices().get_field_choices("local"):
                    if v == row["PROJECT_1"]:
                        local = TreeFlags(key=k, tree=tree, reported_by=self.updater)
                        local.save()
                        break
            if row.get("PROJECT_2"):
                for k, v in Choices().get_field_choices("local"):
                    if v == row["PROJECT_2"]:
                        local = TreeFlags(key=k, tree=tree, reported_by=self.updater)
                        local.save()
                        break
            if row.get("PROJECT_3"):
                for k, v in Choices().get_field_choices("local"):
                    if v == row["PROJECT_3"]:
                        local = TreeFlags(key=k, tree=tree, reported_by=self.updater)
                        local.save()
                        break

            # rerun validation tests and store results
            tree.validate_all()
开发者ID:rcheetham,项目名称:treemapindia.in,代码行数:104,代码来源:uimport.py


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