i am designing a simple project based to do list. the idea is to define tasks under project ( no workflow - just "task is completed" or not is required. ) in a hirarchial way. i.e. each task has multiple task and that task may have other multiple task. a project can be said to be completed if all task under that project are completed. , i tought of using refrenceproeperty to create hirarchy , but could not figure out easy way ( which do not take more than 30 seconds to find all the children of a project and check weather it is completed or not ) . to detect if project is complete or not. how to design database for such job ? and also , if i need to copy the project in order to define another project , how to copy hierarchical data ?
相关问题
- java.lang.NullPointerException at java.io.PrintWri
- __call__() missing 1 required positional argument:
- Upload file to Google Cloud Storage using AngularJ
- Where is the best place to put one-time and every-
- facebook “could not retrieve data from URL”
相关文章
- Is there a size limit for HTTP response headers on
- appcfg.py command not found
- Google app engine datastore string encoding proble
- Angular route not working when used with Google Ap
- Doctrine not finding data on Google App Engine?
- Using OkHttp client via OKClient on Google App Eng
- Storing User Settings - anything wrong with using
- Google appEngine: 404 when accessing /_ah/api [dup
It's probably best to implement the hierarchy of tasks by setting the parent of a task entity to the task entity or project entity to which it belongs.
I think that the trick for finding whether or not all the children of a project are complete or not would be to use ANCESTOR queries.
If you are creating your task records such that their parent is set to the task or project to which they belong, you should be able to write something like this:
The overriding philosophy of the App Engine datastore, as with other nosql databases, is to do your work on write, not on read. With that in mind, you could use parent relationships, as Adam suggests, and keep an 'incomplete count' on each node, which counts the number of immediate children that aren't yet complete. When you mark a node complete, decrement its parent node's count; if that causes it to be complete, move to its parent, and so forth. With a structure like this, you can instantly show if a task is complete or not.