Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Let’s look briefly at how to retrieve entities from the datastore by using keys, how to inspect the contents of entities, and how to update and delete entities. The API methods for these features are straightforward.
Given a complete key for an entity, you can retrieve the entity from the datastore.
In the Python API, you can call the get() function in
the db package with the Key object as an
argument:
from google.appengine.ext import db
k = db.Key.from_path('Entity', 'alphabeta')
e = db.get(k)
If you know the kind of the entity you are fetching, you can also
use the get() class method on the appropriate entity class.
This does a bit of type checking, ensuring that the key you provide is
of the appropriate kind: