提交 f1468735 编写于 作者: X xinwen 提交者: baltery

fix: key=0 修改到 key=1 时 parent_key 没有更新

上级 2b31cb28
......@@ -42,7 +42,9 @@ def change_key0_to_key1(apps, schema_editor):
key_list = n.key.split(':')
key_list[0] = '1'
new_key = ':'.join(key_list)
new_parent_key = ':'.join(key_list[:-1])
n.key = new_key
n.parent_key = new_parent_key
n.save()
print('--> Modify key ( {} > {} )'.format(old_key, new_key))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册