我需要从 JSON 数据更新 Django MPTT 树。我使用 Nestable ( http://dbushell.github.com/Nestable/ ) jQuery 插件配置 django-mptt 以在前端编辑树。
jQuery Nestable 在更新树后提供了这些数据:
[{
"id": 1
}, {
"id": 2,
"children": [{
"id": 3
}, {
"id": 4
}, {
"id": 5,
"children": [{
"id": 6
}, {
"id": 7
}, {
"id": 8
}]
}, {
"id": 9
}, {
"id": 10
}]
}, {
"id": 11
}, {
"id": 12
}]
我如何从这些数据中更新我的 mptt 树?
谢谢!