Skip to content

Commit

Permalink
add support entity
Browse files Browse the repository at this point in the history
  • Loading branch information
lucemia committed Sep 17, 2014
1 parent 0475d5e commit 9bd8642
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gcloud/datastore/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ def get_protobuf_attribute_and_value(val):


def get_value_from_value_pb(value_pb):
from entity import Entity
"""Given a protobuf for a Property, get the correct value.
The Cloud Datastore Protobuf API returns a Property Protobuf
Expand Down Expand Up @@ -102,7 +103,7 @@ def get_value_from_value_pb(value_pb):
return value_pb.blob_value

elif value_pb.HasField('entity_value'):
return value_pb.entity_value
return Entity.from_protobuf(value_pb.entity_value)

elif value_pb.list_value:
return [get_value_from_value_pb(k) for k in value_pb.list_value]
Expand Down

0 comments on commit 9bd8642

Please sign in to comment.