In this page: https://developers.google.com/appengine/docs/python/datastore/keyclass#Key_from_path
This part:
Key.from_path(kind, id_or_name, parent=none, namespace=None, **kwds)
Builds a new Key object from an ancestor path of one or more entity keys.A path represents the hierarchy of parent-child relationships for an entity. Each entity in the path is represented the entity’s kind, and either its numeric ID or its key name. The full path represents the entity that appears last in the path, with its ancestors (parents) as preceding entities.
For example, the following call creates a key for an entity of kind Address with the numeric ID 9876 whose parent is an entity of kind User with the named key ‘Boris’:
k = Key.from_path(‘User’, ‘Boris’, ‘Address’, 9876)
For more information about paths, see Keys and Entity Groups.
The function call and the explaination just don’t make sense here, if Address is the “kind” argument, should it go first?? And the ID 9876 should go second? Why are they 3rd and 4th?
And “parent” is the third parameter, why are there two “parent” arguments (kind ‘User’ and name ‘Boris’) here and they are first and second in the argument list?
Keys in AppEngine are hierarchical, to get a full key you need to pass all the ancestry information.
In the case of the example there are two objects types: User and Address, User is a parent of to Address.
The call to from_path first provides object type User which his id is Boris (id can be a string name or integer id), this object has a child object of type Address which his id is 9876.