core.db.overrides

Functions

key_from_protobuf(pb)

Factory method for creating a key based on a protobuf.

entity_from_protobuf(pb)

Factory method for creating an entity based on a protobuf.

Module Contents

core.db.overrides.key_from_protobuf(pb)

Factory method for creating a key based on a protobuf.

The protobuf should be one returned from the Cloud Datastore Protobuf API.

Parameters:

pb (entity_pb2.Key) – The Protobuf representing the key.

Return type:

google.cloud.datastore.key.Key

Returns:

a new Key instance

core.db.overrides.entity_from_protobuf(pb)

Factory method for creating an entity based on a protobuf.

The protobuf should be one returned from the Cloud Datastore Protobuf API.

Parameters:

pb (entity_pb2.Entity) – The Protobuf representing the entity.

Return type:

google.cloud.datastore.entity.Entity

Returns:

The entity derived from the protobuf.