I was reading the GAE documentation for NDB data storing on this page.
https://developers.google.com/appengine/docs/python/ndb/overview#storing
In the following code,
greeting = Greeting(parent=ndb.Key("Book", guestbook_name or "*notitle*"),
content = self.request.get('content'))
Greeting has a Key set as it’s parent. Besides, that Key is constructed with a “Book” string which seems like just a random string.
Does Key class constructor accepts a random string for kind parameter?
Thank you.
When you set a parent it does not actually have to exist.
So yes, in a way it’s a random string. But if you had a model called
BookThat could have been written like this:
The docs note:
Which is what I did here. Both amount to the same thing.