Helper functions for dealing with Cloud Datastore's Protobuf API.
The non-private functions are part of the API.
Classes
GeoPoint
GeoPoint
(
latitude
,
longitude
)
Simple container for a geo point value.
Name | Description |
latitude | float
Latitude of a point. |
longitude | float
Longitude of a point. |
Modules Functions
entity_from_protobuf
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.
Name | Description |
pb | `.entity_pb2.Entity`
The Protobuf representing the entity. |
Type | Description |
Entity | The entity derived from the protobuf. |
entity_to_protobuf
entity_to_protobuf
(
entity
)
Converts an entity into a protobuf.
Name | Description |
entity | Entity
The entity to be turned into a protobuf. |
Type | Description |
`.entity_pb2.Entity` | The protobuf representing the entity. |
get_read_options
get_read_options
(
eventual
,
transaction_id
)
Validate rules for read options, and assign to the request.
Helper method for lookup()
and run_query
.
Name | Description |
eventual | bool
Flag indicating if |
transaction_id | bytes
A transaction identifier (may be null). |
Type | Description |
`ValueError | if ``eventual`` is ``True`` and the ``transaction_id`` is not ``None``. |
Type | Description |
`.datastore_pb2.ReadOptions` | The read options corresponding to the inputs. |
key_from_protobuf
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.
Name | Description |
pb | `.entity_pb2.Key`
The Protobuf representing the key. |
Type | Description |
Key | a new `Key` instance |