Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions gcloud/datastore/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from gcloud.datastore.key import Key

INT64 = Int64ValueChecker().CheckValue
INT_VALUE_CHECKER = Int64ValueChecker()


def get_protobuf_attribute_and_value(val):
Expand Down Expand Up @@ -56,7 +56,8 @@ def get_protobuf_attribute_and_value(val):
elif isinstance(val, float):
name, value = 'double', val
elif isinstance(val, (int, long)):
name, value = 'integer', INT64(val)
INT_VALUE_CHECKER.CheckValue(val) # This will raise an exception if invalid.
name, value = 'integer', long(val) # Always cast to a long.
elif isinstance(val, basestring):
name, value = 'string', val

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
REQUIREMENTS = [
'httplib2',
'oauth2client',
'protobuf',
'protobuf >= 2.5.0',
'pycrypto',
'pyopenssl',
'pytz',
Expand Down