Module helpers (2.16.1)
 
 
 
 
 
 
 Stay organized with collections
 
 
 
 Save and categorize content based on your preferences.
 
  
 
 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.
| Parameters | |
|---|---|
| Name | Description | 
| latitude | floatLatitude of a point. | 
| longitude | floatLongitude 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.
| Parameter | |
|---|---|
| Name | Description | 
| pb | The Protobuf representing the entity. | 
| Returns | |
|---|---|
| Type | Description | 
| Entity  | The entity derived from the protobuf. | 
entity_to_protobuf
entity_to_protobuf(entity)Converts an entity into a protobuf.
| Parameter | |
|---|---|
| Name | Description | 
| entity | Entity The entity to be turned into a protobuf. | 
| Returns | |
|---|---|
| Type | Description | 
|  | The protobuf representing the entity. | 
get_read_options
get_read_options(eventual, transaction_id, read_time=None)Validate rules for read options, and assign to the request.
Helper method for lookup() and run_query.
| Parameters | |
|---|---|
| Name | Description | 
| eventual | boolFlag indicating if  | 
| transaction_id | bytesA transaction identifier (may be null). | 
| read_time | datetimeRead data from the specified time (may be null). This feature is in private preview. | 
| Exceptions | |
|---|---|
| Type | Description | 
| `ValueError | if more than one of eventual==True,transaction, andread_timeis specified. | 
| Returns | |
|---|---|
| Type | Description | 
|  | 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.
| Parameter | |
|---|---|
| Name | Description | 
| pb | The Protobuf representing the key. | 
| Returns | |
|---|---|
| Type | Description | 
| Key  | a new Keyinstance | 
set_database_id_to_request
set_database_id_to_request(request, database_id=None)Set the "database_id" field to the request only if it was provided.