From google documentation:
“A model instance’s key includes the instance’s entity kind along with a unique identifier. The identifier may be either a key name string, assigned explicitly by the application when the instance is created, or an integer numeric ID, assigned automatically by App Engine when the instance is written (put) to the Datastore. “
so in the example:
name = "John"
idd = 11
person = Person(name, idd)
person.put()
How do i get the “integer numeric ID, assigned automatically by App Engine”?
if you are using ndb put() returns the new key… call the id function on the key:
from https://developers.google.com/appengine/docs/python/ndb/entities :
and:
https://developers.google.com/appengine/docs/python/ndb/keyclass#Key_id