I have hierarchical data stored in the datastore using a model which looks like this:
class ToolCategories(db.Model):
name = db.StringProperty()
parent
The main disadvantage of your approach is that because you're using the "adjacency list" way of representing trees, you have to do one datastore query for each branch of the tree. Datastore queries are fairly expensive (around 160ms each), so constructing the tree, particularly if it's large, could be rather expensive).
There's another approach, which is essentially the one taken by the datastore for representing entity groups: Instead of just storing the parent key, store the entire list of ancestors using a ListProperty:
class ToolCategories(db.Model):
name = db.StringProperty()
parents = db.ListProperty(db.Key)
Then, to construct the tree, you can retrieve the entire thing in one single query:
q = ToolCategories.all().filter('parents =', root_key)