本文整理汇总了Python中treemap.models.Tree.save_with_system_user_bypass_auth方法的典型用法代码示例。如果您正苦于以下问题:Python Tree.save_with_system_user_bypass_auth方法的具体用法?Python Tree.save_with_system_user_bypass_auth怎么用?Python Tree.save_with_system_user_bypass_auth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类treemap.models.Tree
的用法示例。
在下文中一共展示了Tree.save_with_system_user_bypass_auth方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _commit_tree_data
# 需要导入模块: from treemap.models import Tree [as 别名]
# 或者: from treemap.models.Tree import save_with_system_user_bypass_auth [as 别名]
def _commit_tree_data(self, data, plot, tree, tree_edited):
for tree_attr, field_name in TreeImportRow.TREE_MAP.iteritems():
value = data.get(field_name, None)
if value:
tree_edited = True
if tree is None:
tree = Tree(instance=plot.instance)
setattr(tree, tree_attr, value)
ie = self.import_event
tree_udf_defs = udf_defs(ie.instance, 'Tree')
for udf_def in tree_udf_defs:
udf_column_name = ie.get_udf_column_name(udf_def)
value = data.get(udf_column_name, None)
# Legitimate values could be falsey
if value is not None:
tree_edited = True
if tree is None:
tree = Tree(instance=plot.instance)
tree.udfs[udf_def.name] = \
self._import_value_to_udf_value(udf_def, value)
if tree_edited:
tree.plot = plot
tree.save_with_system_user_bypass_auth()
tree.plot.update_updated_fields(ie.owner)