I am making a to-do list application in Python that will show tasks/subtasks/sub-sub-tasks in a tree view, but with higher-level clades of tasks grouped into blocks (e.g., Work block, Home block). So something like:
To Do List
|--Home Tasks
| |--Clean room
| |--Get storage unit
|
|--Work Tasks
|--Analysis
|--Sorting
|--Save Files
| |--Pull from computer 1
| |--Walk to computer 2
| |--Save on computer 2
|--Sort files
|--Plot data
My goal is to store the data as JSON, but I am totally new to this format. I am curious about the quality of the following, and any improvements I could make:
{
"todoList":
[
{
"taskBlock": "Home", "tasks":
[
{"task": "Clean room", "done": false},
{"task": "Get storage unit", "done": false}
]
},
{
"taskBlock": "Work", "tasks":
[
{"task": "Analysis", "done": false},
{"task": "Sorting", "done": false, "subtasks":
[
{"task": "Save files", "done": false, "subtasks":
[
{"task": "Pull from computer 1", "done": false},
{"task": "Walk to computer 2", "done": false},
{"task": "Save on computer 2", "done": false}
]
},
{"task": "Sort files", "done": false},
{"task": "Plot data", "done": false}
]
}
]
}
]
}
I am used to XML, and defining a root item, but frankly I wonder if my "root" item here is superfluous (the 'todoList' parent item).