Depending on whether you use keywords or not, obj.key().name()or obj.key().id()you can use to get a name or identifier, respectively. None of them contain the name of the entity class, so they are not enough to retrieve the source object from the data store. Of course, in most cases, you usually know the type of entity when working with it, so as not to be a problem.
, (keynames ), obj.key().id_or_name(). :
from google.appengine.ext import db
obj_key = db.Key.from_path('EntityClass', id_or_name)
obj = db.get(obj_key)
, , (, GAE), (str(obj.key()) db.get .